请,我的代码无效需要帮助:
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));