所以我遇到了一些可观察的订阅问题。
基本上,我有一堆彼此嵌套的Observable,并且可以按我的期望执行,但其中的一个不会触发订阅。在此返回之前,我仍然有要做的事情。谁能告诉我为什么一个订阅不能执行?
谢谢
public login(): Observable<boolean> {
return Observable.create((observer) => {
this.auth0.parseHash((err, authResult) => {
if (authResult && authResult.accessToken) {
this.setup(authResult).subscribe(ob2 => {
console.log('This subscribe will not')
});
}
});
});
}
private setup(authResult): Observable<any> {
let t = new Observable((ob2) => {
this.accountService.getInvite().subscribe(res => {
if (res.status == 1) {
let dialogRef = this.dialog.open(ProcessInviteComponent, {
autoFocus: false,
width: '35rem',
disableClose: true,
panelClass: ['mt-dialog-overlay']
});
dialogRef.afterClosed().subscribe(result => {
this.accountService.processInvite(result).subscribe( res => {
this.accountService.setupUser(authResult.accessToken).subscribe( res => {
console.log('this subscribe will fire')
});
});
});
}
});
});
return t;
}