首页 文章

rxjs / Subscription没有导出成员'ISubscription'

提问于
浏览
2

我正在从角度5迁移到角度6.当我进行npm运行构建时,我是向控制台抛出以下错误:

ngc编译失败:ng-formly / core / src / components / formly.field.ts(10,10):错误TS2305:模块'“C:/PrjNET/Elevation3/FW/4.00/Mainline/Framework/Development/Client /ElevationJS/ngcore/.tmp/node_modules/rxjs/Subscription“'没有导出的成员'订阅' .

我有一个类似的错误: rxjs/Subscription has no exported member Subscription 我通过导入Subscription来解决这个问题:

import { Subscription } from "rxjs";

但我不能这样做 ISubscription .

任何人都知道如何导入ISubscription?

2 回答

  • 0

    在RxJS v6中, ISubscription 被重命名为 SubscriptionLike ,因为's the convention used in Typescript'拥有自己的类型声明 .

    同样, IScheduler 已重命名为 SchedulerLike .

  • 3

    我不认为你可以直接使用 ISubscription 界面 . 如果检查 Subscription.d.ts ,则该接口没有 declare 类型 . 我认为你必须使用 Subscription ,因为它正在实现 ISubscription 接口 .

相关问题