开发者

Relationship between view and model in Backbone.js

开发者 https://www.devze.com 2023-04-09 19:20 出处:网络
In Backbone.js, how does a view know what model it represents? Is it necessary for the view to be named Model_NameView? Because I can\'t find any other View property or function for settin开发者_如何

In Backbone.js, how does a view know what model it represents?

Is it necessary for the view to be named Model_NameView? Because I can't find any other View property or function for settin开发者_如何学Cg the model (like collection has the model property, to define what models this collection is of)


As you can see at http://documentcloud.github.com/backbone/#View, there is a model property for each view. In other words, you do not have to name the view and model anything in particular.

0

精彩评论

暂无评论...
验证码 换一张
取 消