I am using Angular2 with Visual studio code. In visual studio code It shows me error as shown below :
As seen in the image Promise
is highlighted with red underline. Also I have another query is if we define inline function then Visual studio code will also shows red underline below the name of function. Like response
is shown with red underline in above image.
However my code works fine in browser. but in VS Code it shows me red underline.
I don't want any red underline in my code. Is it possible ? Can anyone help me to resolve this ?
As the visual studio has functionality for visible intellisense for any language, you can just add the typings.json file in root level and add below code to it.
-- your typings.json
{
"globalDependencies": {
"angular-protractor": "registry:dt/angular-protractor#1.5.0+20160425143459"
}
}
and just hit the below command in cmd to current working project directory (install typings globally(-g) if not installed on your machine).
typings install
So only in visual studio, you will get the intellisense and remove the error.
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