【发布时间】:2016-04-10 21:01:03
【问题描述】:
我不确定如何在 typescript、Visual Studio 2015 for Asp.Net MVC 4 中开始使用 Angular2
我有一个包含这个的打字稿文件
import { bootstrap } from 'angular2/platform/browser';
然后我使用 nuget 获取 angular2.TypeScript.DefinitelyTyped
现在编译给了我很多错误,例如
Build: Cannot find module 'angular2/platform/browser'
还有几千个这样的错误
Build: Duplicate identifier 'SetterFn'
这大概是因为存在很多版本的角度 ts 文件
我在网络参考 tsconfig.json 和 Asp.Net Mvc 5/Core 上找到的所有答案
从哪里开始?
【问题讨论】:
-
使用 npm 和来自 npm 的类型来管理肯定类型的类型。 Nuget 缺乏管理它们的类型。 Nuget 类型总是落后于原始 github 版本
-
到目前为止,我已经设法摆脱了不使用 npm 的情况,如果我真的走这条路,不会还有 angular2、alpha26、28、30 等的多个版本。如何typescript 知道使用哪一个吗?
标签: typescript angular