Angular 6升级:debounceTime不是Subject的属性 [英] Angular 6 upgrade: debounceTime is not property of Subject

查看:87
本文介绍了Angular 6升级:debounceTime不是Subject的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的应用程序从Angular 5升级到Angular6.我按照 https://update上的步骤进行操作.angular.io/ 至少我认为我做到了.

I am attempting to upgrade my app from Angular 5 to Angular 6. I followed the steps on the https://update.angular.io/ At least i think i did.

错误是:

Property 'debounceTime' does not exist on type 'Subject<string>'.

我的组件也丢失了debounceTime导入.我认为ng更新已将其删除.

Also my components lost the debounceTime import. I think the ng update removed it.

推荐答案

我在@ Siva636和@Andrew Lobban的帮助下解决了它.

I solved it with the help of @Siva636 and @Andrew Lobban.

我需要使用管道:

  this.field$.pipe(
      debounceTime(400),
      distinctUntilChanged())

这篇关于Angular 6升级:debounceTime不是Subject的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆