I'm working on an Angular2-Typescript application. I've generated the project with angular-cli as follows:
ng new myApp
but when I create a new component, a warning appears on @Component tag.
I've tried to solve following this post:
Experimental decorators warning in Visual Studio Code
but does not work for me.
I attach my tsconfig.json:
{
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es6",
"typeRoots": [
"../node_modules/@types"
]
}
}
Typescript version is : "typescript": "2.0.2"
Finally, I solved my problem as follows:
First, updating typescript version:
$ npm install typescript@next
and then, editing user preference in vscode, adding the following:
{
"typescript.tsdk": "node_modules/typescript/lib"
}
Thanks to peeskillet :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With