【发布时间】:2017-12-11 20:51:32
【问题描述】:
我正在尝试编写注销方法。在注销之前我试图取消订阅我以前的订阅,否则我会收到很多订阅和权限错误
这是退出方法(按钮点击触发)
console.log(this.profileData);
this.profileData.unsubscribe();
this.app.auth().signOut().then(function() {
alert("you successfully signed out");
}, function(error) {
alert("error");
});
这就是我订阅的方式
this.profileData = this.fire.authState.switchMap(auth => this.db.object(`profile/${auth.uid}`).valueChanges());
this.profileData.subscribe(profile =>{...
【问题讨论】:
-
这个问题仍然有效
标签: angular firebase rxjs angularfire2