Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Backbone.js Vs Knockout.js [closed]

I read the following about JavaScript MVC based patterns (Backbone Vs Knockout)

  1. If data binding and two-way communication are your main concerns, KnockoutJS is definitely the way to go. Practically any attribute or value stored in DOM nodes can be mapped to JavaScript objects with this approach.
  2. Backbone excels with its ease of integration with RESTful services, while KnockoutJS Models are simply JavaScript objects and code needed for updating the Model must be written by the developer.
  3. With KnockoutJS, we can bind our own functions to ViewModel observables, which are executed anytime the observable changes. This allows us the same level of flexibility as can be found in Backbone

Could you please provide very basic/simple examples for the above points ?

like image 507
copenndthagen Avatar asked Oct 24 '25 19:10

copenndthagen


1 Answers

knockout is good, but when your models contain many variables and functions this will result in very dirty and hard readable html. backbone is good but it does not have observables, which make Knockout so easy to use.

Pay attention to AngularJS, it combines both Knockout and Backbone, it's faster, leaves html readable, has two way data-binding, validation and much more. also you can try EmberJS

like image 79
Romko Avatar answered Oct 26 '25 07:10

Romko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!