加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular – “ObservableMedia”类型中的属性“subscribe”不能

发布时间:2020-12-17 06:55:10 所属栏目:安全 来源:网络整理
导读:我刚刚升级到我的Angular 6应用程序,现在我得到: ERROR in node_modules/@angular/flex-layout/core/typings/observable-media/observable-media.d.ts(11,14): error TS2416: Property 'subscribe' in type 'ObservableMedia' is not assignable to the sam
我刚刚升级到我的Angular 6应用程序,现在我得到:

ERROR in node_modules/@angular/flex-layout/core/typings/observable-media/observable-media.d.ts(11,14): error TS2416: Property 'subscribe' in type 'ObservableMedia' is not assignable to the same property in base type 'Subscribable<MediaChange>'.
  Type '(next?: (value: MediaChange) => void,error?: (error: any) => void,complete?: () => void) => Sub...' is not assignable to type '{ (observer?: PartialObserver<MediaChange>): Unsubscribable; (next?: (value: MediaChange) => void...'.
    Types of parameters 'next' and 'observer' are incompatible.
      Type 'PartialObserver<MediaChange>' is not assignable to type '(value: MediaChange) => void'.
        Type 'NextObserver<MediaChange>' is not assignable to type '(value: MediaChange) => void'.
          Type 'NextObserver<MediaChange>' provides no match for the signature '(value: MediaChange): void'.
src/app/core/order-store.service.ts(152,7): error TS2345: Argument of type 'MonoTypeOperatorFunction<any[]>' is not assignable to parameter of type 'OperatorFunction<Order,any[]>'.
  Types of parameters 'source' and 'source' are incompatible.
    Type 'Observable<Order>' is not assignable to type 'Observable<any[]>'.
      Type 'Order' is not assignable to type 'any[]'.
        Property 'includes' is missing in type 'Order'.

解决方法

RxJS从6.2升级到6.3(遗憾地)改变了打破flex-layout的订阅界面.幸运的是,flex-layout发布了一个修复程序;更新到最新版本:

"@angular/flex-layout": "6.0.0-beta.18",

并安装它:

npm install @angular/flex-layout

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读