加载AngularJs 2打字稿文件时出现问题

时间:2016-06-20 18:06:33

标签: typescript visual-studio-2015 angular typescript1.8

我得到了下面的打字稿错误,如图所示,所有都是打字稿文件相关的错误,如属性不存在,无法找到名称。

Angular 2 TYpescript errors

1 个答案:

答案 0 :(得分:1)

tsconfig.json中排除node_modules文件夹

  {
      "compilerOptions": {

        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "module": "commonjs",
        "noEmitOnError": true,
        "noImplicitAny": false,

        "removeComments": false,
        "sourceMap": true,
        "target": "es6",
        "moduleResolution": "node",
        "suppressImplicitAnyIndexErrors": true,
        "watch":true
      },
      "compileOnSave": true,
      "exclude": [
        "node_modules",
        "typings/main",
        "typings/main.d.ts",

        "typings"
      ]
    }