I have been playing with the tutorials on the knockout site and have enjoyed working with it.
So i decided to make a simple site with it. I was saddened to notice that i lose a lot of the support from the IDE when working with the javascript templates (highlighting, code completion)
Example template:
<script type="text/html" id="taskTemplate">
<li>
<input type="checkbox" data-bind="checked: isDone" />
<input data-bind="value: title, enable: !isDone()" />
<a href="#" data-bind="click: remove">Delete</a>
</li>
</script>
Is this something you have to just swallow or is it avoidable / fixable? Templates seem to be one of the most used ways of building up the page and so i would prefer to have the support from the IDE.
To get around this I create two html helpers for the begining of my script tag and the end of my script tag. Something like:
<% Html.BeginTemplate(new { id = "features-template" }); %>
<li>
<input type="checkbox" data-bind="checked: isDone" />
<input data-bind="value: title, enable: !isDone()" />
<a href="#" data-bind="click: remove">Delete</a>
</li>
<% Html.EndTemplate(); %>
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