工作,我注意到,每一次我在推棧頁面時,它調用ionViewloaded
和我添加subscribe()
我的問題是我不能退訂,當我彈出的頁面。這是我的代碼。它不起作用。訂閱和退訂不離子2
ionViewDidLoad() {
this.user = this.navParams.data;
this.events.subscribe('close:userPopOver', this.onRemovePopOver.bind(this));
}
ionViewWillLeave() {
alert('FIRES!!');
this.events.unsubscribe('close:userPopOver', this.onRemovePopOver.bind(this));
}
並訂閱來自rxjs /接收? 我收到了一個警告類型void無法指定鍵入'Subscription' – domzgarcia
'import {subscription} from「rxjs/Subscription」;' –
this.events.subscribe()return void無法分配給訂閱 – domzgarcia