vignesh vignesh - 28 days ago 7
AngularJS Question

visual studio showing errors in typescript files but code works fine

I am starting to learn angular2

and I happened to clone the Angular 2 Quickstart from github

Now, what I noticed is that, some of the statements in typescript files are shown as errors in Visual Studio, but they actually work

enter image description here

I checked a similar question which was resolved by installing MVC4 in the machine.

What should I install/do to fix this?

Answer

In my experience Visual Studio is a bit unstable with regards to this on-the-fly sync and compile. What helped me is just a simple restarting of Visual Studio (if all other stuff is in order).

If that does not help, it's better to update TypeScript to latest version. I do it first thing in Visual Studio. You cannot do it directly from extension tab unfortunately, so you need to download it from MS site.

P.S. The Url might change later of course if new versions are released.

Comments