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

 【出现的问题】TS2339: Property ‘debounceTime’ does not exist on type ‘Observable<any>’.

《TS2339: Property 'debounceTime' does not exist on type 'Observable<any>‘. – Angular 6》” /></p><p> </p><p> </p><p>【解决方法】</p><p>第一步,在 Terminal 更新 Angular</p><pre>ng update</pre><p>第二步,fix the rxjs</p><pre>npm i -g rxjs-tslint</pre><p>第三步,修改代码,不再使用debounceTime(500),而是在外边添加 .pipe(),即变成.pipe(debounceTime(500))</p><pre><span style=this.titleFilter.valueChanges .pipe(debounceTime(500)) .subscribe( value => this.keyword );

 

 

参考

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

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

    原文作者:coco1989
    原文地址: https://www.cnblogs.com/coco1989/p/9371629.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞