Typescript 为什么会更改为SafeSubscription
我需要找出为什么我的Typescript 为什么会更改为SafeSubscription,typescript,ionic-framework,ionic2,rxjs,Typescript,Ionic Framework,Ionic2,Rxjs,我需要找出为什么我的这个对象在我的TS和ionic应用程序中从view controller变为SafeSubscriber 我的数据服务: getStationData(name:string){ let myURL = "http://some/url/request.php?name="+ name; return this.http.get(myURL) .map( res =&g
这个对象在我的TS
和ionic
应用程序中从view controller
变为SafeSubscriber
我的数据服务:
getStationData(name:string){
let myURL = "http://some/url/request.php?name="+ name;
return this.http.get(myURL)
.map(
res => {return this.parseData(res._body);},
err => console.log(err));
};
我的视图控制器:
//here, this is still the correct object : view controller
this._dataService.getStationData(name).subscribe((data) =>{
//here, this now becomes of type safe subscriber?
console.log(this);
//when I hover in chrome over this, it shows all view controller parameters.
//but when I call a method, it's not defined?
});
http.get
请求是否有问题?您正在将错误处理程序作为thisArg
传递给。这很可能与你的问题有关。谢谢,我会查一查的。有趣的是,它曾用于以前的Angular/Ionic版本,但在最近的更新失败后。。。