我正在尝试使用 tsconfig.json,这样我就可以避免在一堆文件的顶部。但我不断收到此错误:
[ts] 找不到命名空间“ng”。任何
我的tsconfig.json
文件如下所示:
{
"compileOnSave": true,
"compilerOptions": {
"noImplicitAny": false,
"target": "es2015",
"allowSyntheticDefaultImports": true
},
"files": [
"./typings/index.d.ts"
]
}
如您所见,我将其指向我的index.d.ts
文件,如下所示:
/// <reference path="globals/angular-ui-router/index.d.ts" />
/// <reference path="globals/angular/index.d.ts" />
/// <reference path="globals/jquery/index.d.ts" />
但是,如果我将此引用放在模块的顶部:
app.controller.js
/// <reference path="../../../../typings/index.d.ts" />
...
它识别ng
并给我它的类型。为什么这可能不起作用?
任何帮助表示赞赏。提前致谢!