Code:
// ngimport.d.ts:
export declare let $anchorScroll: angular.IAnchorScrollService;
export declare let $cacheFactory: angular.ICacheFactoryService;
export declare let $compile: angular.ICompileService;
export declare let $controller: angular.IControllerService;
export declare let $document: angular.IDocumentService;
...
Each of the angulars above throws an error in VSCode: [ts] Cannot find namespace 'angular' \ any.
And when I import ngimport from another project, I get Error TS2503: Cannot find namespace 'angular'
typings.json:
{
"ambientDependencies": {
"angular": "registry:dt/angular#1.5.0+20160517064839",
"jquery": "registry:dt/jquery#1.10.0+20160316155526"
}
}
tsconfig.json:
{
"compilerOptions": {
"module": "es6",
"moduleResolution": "node",
"noImplicitAny": true,
"preserveConstEnums": true,
"outDir": ".",
"sourceMap": false,
"target": "es6"
},
"files": [
"./typings/main.d.ts",
"./ngimport.ts"
]
}
Full source: https://github.com/bcherny/ngimport
Code:
Each of the
angulars above throws an error in VSCode:[ts] Cannot find namespace 'angular' \ any.And when I import
ngimportfrom another project, I getError TS2503: Cannot find namespace 'angular'typings.json:
{ "ambientDependencies": { "angular": "registry:dt/angular#1.5.0+20160517064839", "jquery": "registry:dt/jquery#1.10.0+20160316155526" } }tsconfig.json:
{ "compilerOptions": { "module": "es6", "moduleResolution": "node", "noImplicitAny": true, "preserveConstEnums": true, "outDir": ".", "sourceMap": false, "target": "es6" }, "files": [ "./typings/main.d.ts", "./ngimport.ts" ] }Full source: https://github.com/bcherny/ngimport