构建angular2mvc应用程序的问题 [英] Issues in building the angular2mvc application
问题描述
我是Angularjs2的新手,我无法构建文章中提到的应用程序Angular2MVC。我尝试了谷歌提出的多个解决方案,但仍然无法解决,我收到的错误如下:
1错误构建:类'WebSocketSubject< t>'错误地扩展基类'AnonymousSubject< t>'。 Angular2MVC F:\ MyLabs \Angular2MVC \ node_modules \ rxjs \ observable\dom\WebSocketSubject.d.ts 23
2.
I am new to Angularjs2, I am not able to build the application Angular2MVC referred in the article. I tried multiple solutions suggested over google, but still not able to resolve, I am receiving few errors as below:
1 Error Build:Class 'WebSocketSubject<t>' incorrectly extends base class 'AnonymousSubject<t>'. Angular2MVC F:\MyLabs\Angular2MVC\node_modules\rxjs\observable\dom\WebSocketSubject.d.ts 23
2.
export declare class Subject<T> extends Observable<T> implements ISubscription {
3.
3.
Severity Code Description Project File Line Suppression State
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'. TypeScript Virtual Projects F:\MyLabs\Angular2MVC\node_modules\rxjs\observable\dom\WebSocketSubject.d.ts 23 Active
4.
4.
Severity Code Description Project File Line Suppression State
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'. TypeScript Virtual Projects F:\MyLabs\Angular2MVC\node_modules\rxjs\Subject.d.ts 16 Active
谢谢提前,
Sunil Wagh
我尝试过:
我尝试安装新版本的TypeScript,我试图安装不同版本的TypeScript,如2.4.0等,不同版本的rxjs在Package.json中建议通过谷歌。我也丢弃了package.json,它是本文的一部分,并尝试从命令提示符下使用npm init创建新的,但问题仍未得到解决。
Thanks in advance,
Sunil Wagh
What I have tried:
I tried installing new version of TypeScript, I tried to install different versions of TypeScript like 2.4.0 etc, different version of rxjs in Package.json as suggested over google. Also I discarded package.json which is part of the article and tried to create new one with npm init from the command prompt, but the issue is still not resolved.
推荐答案
在nuget中添加打字稿
Microsoft.TypeScript.Compiler 2.6.2
noStrictGenericChecks:true,
$ b tsconfig.json中的$ b。
Add also typescript in nuget
Microsoft.TypeScript.Compiler 2.6.2
"noStrictGenericChecks": true,
in tsconfig.json.
什么文章?文章不是由网站撰写的,而是由志愿者撰写的。他们是由编写它们的人支持的。
如果您在CP上的文章中遇到代码问题,底部有一个论坛发表您的疑虑的文章。这样,撰写文章的人就会收到您发布问题或评论的通知。
What article? Articles are not written by the site but by volunteers. They are supported by the people who wrote them.
If you've got an issue with the code in an article here on CP, there is a forum at the bottom of the article to post your concerns. That way, the person who wrote the article will be notified you posted a question or comment.
这篇关于构建angular2mvc应用程序的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!