angular - 'ObservableMedia' 类型中的属性 'subscribe' 不可分配给基类型 'Subscribable' 中的相同属性'
问题描述
我刚刚ng upgrade
对我的 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(很遗憾)改变了 subscribe 接口,导致flex-layout
. 幸运的是,flex-layout
发布了一个修复程序;更新到最新:
"@angular/flex-layout": "6.0.0-beta.18",
并安装它:
npm install @angular/flex-layout
推荐阅读
- android - ViewPager2 滑动选项卡布局不显示片段名称
- python - 用 Python 绘制几种颜色的冲浪图
- cypress - 在柏树中,有没有办法检查一定数量的相同文本或链接实例?
- c# - 正则表达式检查字符串中某处至少 2 个字符
- reactjs - Redux 存储包含正确的状态,但似乎是错误的
- python - 在 Anaconda 中找不到 pygame
- javascript - 使用 foreach asp.net 核心中的 multiplus 按钮获取值
- qt - 使用 QML OpacityMask 对覆盖矩形的上角进行四舍五入
- python - Nginx 和 Gunicorn WSGI 变量
- php - 安装 Guzzle 后 Laravel Scout 错误“未定义的类常量 'VERSION'”