I have defined the following Angular2 component:
import {Component} from \'angular2/core\';
@Component({
selector: \'my-app\',
moduleId: module.id,
te
I use VS 2015, and had same issues, but I have resolved using:
add the typings.json file from the angular.io website (2.0.0 final at the moment) and the run:
typings install // don't forget to install typings globally
then
npm install -D @types/node --save
in the package.json I have
"devDependencies": {
"@types/node": "6.0.40",
...
in the typings.json I have the following configuration
{
"compilerOptions": {
"target": "es5",
"module":"commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": true,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true,
"types": []
},
"exclude": [
"node_modules",
"app-dist"
]
}
I had to add the types as an empty array
p.s. to me personally is a strange issue, because as soon as you exclude typings inside typings.json, you have immediately highlighted 'module', but if you let it in, you have lot's of duplicates. Don't know who to blame, me, typescript or visual studio :)