How Read a JSON File using smart-table
- Linguagem predominante
- TypeScript
- Estrelas
- 1.6k
- Forks
- 867
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
This is what I have right now but I'm getting the 404 error saying that the data.json file is not found
`
data;
constructor(private http:Http) {
this.http.get('./data.json')
.subscribe(res => this.data = res.json());
console.log(this.data);
}
`
- I confirmed the JSON is valid
- The data.json file is under the same folder as app.component.ts
- I've imported Http from @angular/http and in app.component.ts
- I've imported HttpModule from @angular/http in app.module.ts and added HttpModule to imports
- The code is in
`export class AppComponent {
//....
}
`
in app.component.ts
Can anyone help me or have a separate example of how they read a json file (perhaps there's another technique)
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Avaliação
Esta issue ainda não foi avaliada.