我把这个放在我的部件中:当我将"strictFunctionTypesTypeScript sources through NGC
ERROR: path/to/my/component.component.ts:28:10 - error TS2322: Type 'BehaviorSubject<false>
所以我用BehaviorSubject做了这个。如果我将服从订阅函数的行为传递给订阅函数,则会发出值,但要看到这一点,您必须在使用BehaviorSubject作为PartialObserver之前进行订阅。在BehaviorSubject的docs中,您可以找到以下内容:
A variant of Subject that requires an initial value and emits its current因此,当使用BehaviorSubject作为partialObserver时,这种行为会中断。title