Reputation: 1842
I have a cordova project using typescript. It works fine in Visual Studio 2015 RC, but after updating to 2015 RTM, the VS intellisense shows error "import declaration conflicts with local declaration of 'ng'" on the statement import ng = angular;
in angular.d.ts
.
import ng = angular; //intellisense error: import declaration conflicts with local declaration of 'ng'
// Support AMD require
declare module 'angular' {
export = angular;
}
I have checked my solution and I am sure there is declare module ng
elsewhere.
Any ideas?
Upvotes: 0
Views: 10564
Reputation: 131
I had this error "import declaration conflicts with local declaration of 'ng'
" in my Visual Studio 2015 solution where I used bower to manage my angular related packages.
The problem is Visual Studio Typescript compiler considers all .ts files in the directory even though they are not included as part of the project and causes a conflict between the bower version of angular-ui-router
and the actual DefinitelyTyped version.
The bower
version of angular-ui-router
already contains a .d.ts file as /api/angular-ui-router.d.ts
and causes the double definition. Simply delete it from your directory and error will disappear from Visual Studio Error window.
Upvotes: 2
Reputation: 1842
Add a tsconfig.json as specified in How to set TypeScriptTarget in Visual Studio 2015 RTM solves this issue as a side effect ^_^.
Upvotes: 1