I did my first knockout.js application http://jsfiddle.net/Pqs7e/
For display application parts (books section, about section) I use jquery $("#id").show(). I feel this is not right way. How can I do this through the mechanism of the viewmodel?
An alternate way to do this is with templates:
<div data-bind="template: state">
Template renders here
</div>
Then your sections can be defined somewhere like this (in the same file or elsewhere):
<script id="books" type="text/html">
Your markup here...
</script>
<script id="about" type="text/html">
Your markup here...
</script>
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