Models vs Views in Backbone.js

From couple of days, I have started working/learning the [backbone.js][1]. I have read documentation on their site. I have also read few tutorials available [here][2]. As per my understanding below are few major differences between Views and Models. - Only view has 'el'. *Why it is not there in Model ?* - Only Models have 'get','set', 'save' methods. - Only Models have functions like fetch, save, destroy, validate methods,clear,has. According Hello World examples [here][3], View can also do the things Models can do. - Both have extend, render, initializer, getter setter methods. - Both can be converted into JSON using toJSON. 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. [1]: [2]: [3]:
a very nice resource to backbone is it is very helpful when you are beginning to play with the framework

以上就是Models vs Views in Backbone.js的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准