Reputation: 10685
From couple of days, I have started working/learning the backbone.js. I have read documentation on their site. I have also read few tutorials available here.
As per my understanding below are few major differences between Views and Models.
According Hello World examples here, View can also do the things Models can do.
hence, I am confused between Models and Views. When to use each one ?
my question is.. what is practical difference between Models and Views? What are different situations to use Models/Views ? What should be appropriate to use for displaying(render)?
Can anyone good @ Backbone.js explain with practical scenario ?
Your help will make my understanding much clear.
Upvotes: 4
Views: 752
Reputation: 11718
Model and Views are not Backbone terms. You can read about MVC paradigm first. Model contain data and logic for data manipulations. View describes how this data should be displayed. Hence only View have 'el' - because this it is used while displaying data. Getters and setters are in model according to MVC paradigm.
Upvotes: 2