Here What could be the return type of getFiles () (except any), what could be a particular return type?
@Injectable()
export class NodeService {
constructor(private http: Http) {}
getFiles() {
return this.http.get('./resources/data/cars-medium.json')
.map((res: any) => res.json().data);
}
}
cars-medium.json
{
"data":[
{"vin":"a1653d4d","brand":"VW","year":1998,"color":"White"},
{"vin":"ddeb9b10","brand":"Mercedes","year":1985,"color":"Green"},
{"vin":"d8ebe413","brand":"Jaguar","year":1979,"color":"Silver"},
{"vin":"aab227b7","brand":"Audi","year":1970,"color":"Black"},
{"vin":"631f7412","brand":"Volvo","year":1992,"color":"Red"},
{"vin":"7d2d22b0","brand":"VW","year":1993,"color":"Maroon"}
]
}
source
share