RXJS的内部函数主题

时间:2019-07-12 14:41:40

标签: javascript angular ionic-framework rxjs subject-observer

请,我的代码无效需要帮助:

this.howToUseObservables().subscribe(ress => alert('in app ' + ress));

为什么testSubject.next('test');完全不触发? 谢谢

howToUseObservables(): Subject<any> {
const testSubject: Subject<any> = new Subject();
testSubject.next('test');
return testSubject;
}

this.howToUseObservables().subscribe(ress => alert('in app ' +ress));

0 个答案:

没有答案