您可以使用setter,如果你有过的功能没有控制这台价值,name或者如果你只是想避免增加逻辑,每一个的那些功能(如果有很多人):const _subject = new Subject();// keep good practise and do not subscribe to Subjects:const observable$ = _subject.asObservable();let _name;set name(name) { _name = name; subject.next(name);};// also adding a getter in case you want to use 'name' somewhere elseget name() { return _name;}// magic happens hereobservable$.subscribe(_name => {...});setTimeout(_ => { name = 'foo';}, 1000);这将在每次name获取值时发出,但您可以。前任。pipe(take(1))它只会发出一次 - 在name获得一个值之后