private extractData(res
: Response) {
let body = res.json();
console.info(res.json());
return body || { };
}
private handleError (error : any) {
// In a real world app, we might use a remote logging infrastructure
// We'd also dig deeper into the error to get a better message
let errMsg = (error.message) ? error.message :
error.status ? `${error.status} - ${error.statusText} ` : 'Server error';
console.error(errMsg); // log to console instead
return Observable.throw(errMsg);
let body = res.json();
console.info(res.json());
return body || { };
}
private handleError (error : any) {
// In a real world app, we might use a remote logging infrastructure
// We'd also dig deeper into the error to get a better message
let errMsg = (error.message) ? error.message :
error.status ? `${error.status} - ${error.statusText} ` : 'Server error';
console.error(errMsg); // log to console instead
return Observable.throw(errMsg);
}
如上一样,需要为handleError 添加private ,不加或者为public的话, ionic serve 没错,但是ionic build ios 会出错。