700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > TS2339: Property 'debounceTime' does not exist on type 'Observableany'. - Angular 6

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

时间:2023-09-13 01:25:02

相关推荐

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

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

【解决方法】

第一步,在 Terminal 更新 Angular

ng update

第二步,fix the rxjs

npm i -g rxjs-tslint

第三步,修改代码,不再使用debounceTime(500),而是在外边添加 .pipe(),即变成.pipe(debounceTime(500))

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

【参考】

/questions/49811177/angular-6-rxjs-import-syntax#answer-50342338

/ReactiveX/rxjs/issues/3723#issuecomment-390855559

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。