4 ms·
ViewModels differ from Views exactly in this: they own states, methods and properties allowing the views to be logic-less. If you consider, in Backbone.js, tha
by Kototama 14y ago
ViewModels differ from Views exactly in this: they own states, methods and properties allowing the views to be logic-less.
If you consider, in Backbone.js, that your templates are the views, then the Backbone Views are a kind of controllers. What are the advantages of Knockback.js here? I'm sure there are but it's not clear to me given the description.
Alternatively in backbone.js you can create object models related to View but that are not part of your business logic.
- chinchang 14y agoMain benefit of Knockback.js over Backbone.js is that: - It makes a clear distinction between Views and logic by providing ViewModels. You don't need to have the a single class rendering data and processing logic also. - Provides the data-bind based templating which cleans up the backbone.js render function that requires DOM manipulation through libraries like jQuery.
- saryant 14y agoCan the person(s) who downvoted this please explain the downvotes? As someone unfamiliar with both of these some context would be very appreciated.