product-service.ts
provinsi():Observable<any> {
return this.http.get('http://127.0.0.1:8000/api/provinsi').pipe(
map(this.extractData),
catchError(this.handleError));
}
public extractData(res: Response) {
let body = res;
return body || {};
}
restaurant.ts
provinsi() {
this.pservice.provinsi()
.subscribe(data => this.provinsis = data.results);
}
json
{"results":[{"province_id":"1","province":"Bali"},{"province_id":"2","province":"Bangka Belitung"} . . .
i need a way to extract my json to angular / ionic view , when i run my apps, still appear "runtime error"