10
I’m using Visual Studio 2012 to edit HTML and JavaScript. I’m adding templates by using partial views in inline script tags (see code below). AngularJS, a Javascript framework, requires that the type be text/ng-template, but Visual Studio does not recognize it as being HTML and does not provide syntax highlighting. If the type is text/HTML everything works fine.
My question: is there a way in Visual Studio 2012 to associate a custom script type to do HTML syntax highlighting? The solution should work not just for text/ng-template, but for other types where you want HTML syntax highlighting.
<script type="text/ng-template" id="filterOrder.html">
<!-- Sidebar comment-->
Search: <input ng-model="query"/>
Sort by:
<select ng-model="orderProp">
<option value="name">Alphabetical</option>
<option value="age">Newest</option>
</select>
<div id="status">Current filter: {{query}}</div>
</script>