ionic和angular中使用rxjs的Observeble,其方法需要是private,不然build會出錯



private extractData(resResponse) {
  let body res.json();
  console.info(res.json());
  return body|| { };
}
private handleError (errorany) {
  // 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 會出錯。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章