4

Knockout highlighting is not working for me in VS2013. Given that I have the "knockout highlight color" setting:

enter image description here

...my assumption is that it should be working.

However, no dice:

enter image description here

Any ideas?

Shaun Rowan
  • 9,269
  • 4
  • 28
  • 52

1 Answers1

3

I had the exact same issue. I am a total newbie to Visual Studio, and given that the Web Essentials listed knockoutJS intellisense out of the box I did not think one needed to do anything to 'turn it on'. Also, it seems support for Mustache templating and Angulars ng-bind syntax works out of the box so I was just as perplexed as you.

This is what I did:

I added an entry for a '_refereences.js' file as described in the answer for Intellisense doesn't work for JavaScript in Visual Studio 2012

I then created the file, and dragged the knockout.3.0.0.js file into the code area like descirbed on this blog

That gave me syntax highlight for Knockout data-binds, as well as Intellisense for Knockout.

Edit: Also check out this blogpost by Mads Christensen, the man behind Web Essentials. In the blog post he describes what _references.js is for, and how to use it.

Community
  • 1
  • 1
SuneRadich
  • 178
  • 1
  • 14
  • Thanks! _references.js did the trick! I did not need to do anything within VS settings - just add the _references.js file to the ~/Scripts/ folder and add the triple slash references to knockout. – Shaun Rowan Jan 14 '14 at 22:06
  • 1
    Did the same steps, but with no luck.. :'( – nZeus Apr 03 '14 at 08:38