Angular 4问题

时间:2017-07-24 02:43:07

标签: angular

我已从Angular 2最新版Angular 4升级,当我尝试运行应用程序并收到以下警告消息时。有人可以就此提出建议。

node_modules/rxjs/Subject.d.ts(16,22): error TS2415: Class 'Subject<T>' incorrectly extends base class 'Observable<T>'.
  Types of property 'lift' are incompatible.
    Type '<R>(operator: Operator<T, R>) => Observable<T>' is not assignable to type '<R>(operator: Operator<T, R>) => Observable<R>'.
      Type 'Observable<T>' is not assignable to type 'Observable<R>'.
        Type 'T' is not assignable to type 'R'.
node_modules/rxjs/observable/dom/WebSocketSubject.d.ts(23,22): error TS2415: Class 'WebSocketSubject<T>' incorrectly extends base class 'AnonymousSubject<T>'.
  Types of property 'lift' are incompatible.
    Type '<R>(operator: Operator<T, R>) => WebSocketSubject<R>' is not assignable to type '<R>(operator: Operator<T, R>) => Observable<T>'.
      Type 'WebSocketSubject<R>' is not assignable to type 'Observable<T>'.
        Types of property 'operator' are incompatible.
          Type 'Operator<any, R>' is not assignable to type 'Operator<any, T>'.
            Type 'R' is not assignable to type 'T'.

1 个答案:

答案 0 :(得分:1)

这是typescript泛型类型检查的问题。将TypeScript版本从2.4.x转换为 2.3.2

https://github.com/ReactiveX/rxjs/issues/2701