TS2339: Property 'debounceTime' does not exist on type 'Observable'. -...

 【出現的問題】TS2339: Property 'debounceTime' does not exist on type 'Observable<any>'.git

 


 

【解決方法】github

第一步,在 Terminal 更新 Angularnpm

ng update

第二步,fix the rxjsthis

npm i -g rxjs-tslint

第三步,修改代碼,再也不使用debounceTime(500),而是在外邊添加 .pipe(),即變成.pipe(debounceTime(500))spa

this.titleFilter.valueChanges .pipe(debounceTime(500)) .subscribe( value => this.keyword );

 


 

參考code

https://stackoverflow.com/questions/49811177/angular-6-rxjs-import-syntax#answer-50342338blog

https://github.com/ReactiveX/rxjs/issues/3723#issuecomment-390855559rxjs

相關文章
相關標籤/搜索