【问题标题】:Issue in loading AngularJs 2 typescript files加载 AngularJs 2 打字稿文件时的问题
【发布时间】:2016-10-22 02:15:17
【问题描述】:

我收到以下打字稿错误,如图所示,都是打字稿文件相关的错误,例如属性不存在和找不到名称。

【问题讨论】:

  • 你需要安装typings

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


【解决方案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"
      ]
    }

【讨论】:

    猜你喜欢
    • 2016-01-25
    • 2017-12-20
    • 2016-06-21
    • 1970-01-01
    • 2018-07-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多