我收到了Module "ng" has no exported member
Visual Studio代码中所有输入的错误消息
我的打字是100%工作,直到我添加angular-ui-router.我不确定这是不是问题,但我在添加之后才注意到它.
在我的.d.ts
文件中,我自己得到一个特定的错误angular
.
我tsd.json
看起来像这样
{ "version": "v4", "repo": "borisyankov/DefinitelyTyped", "ref": "master", "path": "typings", "bundle": "typings/tsd.d.ts", "installed": { "angular-material/angular-material.d.ts": { "commit": "5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff" }, "jquery/jquery.d.ts": { "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe" }, "angularjs/angular.d.ts": { "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe" }, "angularjs/angular-route.d.ts": { "commit": "5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff" }, "angularjs/angular-cookies.d.ts": { "commit": "5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff" }, "angularjs/angular-animate.d.ts": { "commit": "5a8fc5ee71701431e4fdbb80c506e3c13f85a9ff" }, "angularjs/angular-resource.d.ts": { "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe" }, "angular-ui-router/angular-ui-router.d.ts": { "commit": "40c60850ad6c8175a62d5ab48c4e016ea5b3dffe" } } }
我有点迷失了我已经或者没有做过的事情.奇怪的是,一切仍然100%工作.所以我仍然得到intellsense ng.
它只是说有错误,每次我建立我得到所有文件的多重错误.
更新
我结束了注释掉import ng = angular;
就行17
,然后改变ng.auto.IInjectorService;
到angular.auto.IInjectorService;
上线173
的angular.d.ts
这意味着角度应用程序中的每个引用现在都是使用angular
而不是ng
,这不是理想的,但它现在可以做到.我很确定这不是"最佳实践"修复.
https://github.com/DefinitelyTyped/DefinitelyTyped/issues/7284