admin管理员组文章数量:1316518
Can I have a view without a model?
I just want to render some data with the backbone view that I'm familiar with. The data doesn't map to a REST url or some model.
Can I do that or should I just make a model anyway?
Can I have a view without a model?
I just want to render some data with the backbone view that I'm familiar with. The data doesn't map to a REST url or some model.
Can I do that or should I just make a model anyway?
Share Improve this question asked Jan 25, 2012 at 3:04 HarryHarry 55k76 gold badges185 silver badges270 bronze badges2 Answers
Reset to default 9You don't always need a model.
Models and views don't have to be 1:1. In fact, they probably rarely are in practice. Some views might render data for several different models. Others might not, and instead might listen for DOM events, or render data from a third-party source, or any number of other things that don't require a model.
Models and Views are not tied together. There are no dependencies between the other.
You don't have to have a model to make a view.
You can just make Backbone render your data using the backbone's view.
本文标签: javascriptbackbonejs view without a modelStack Overflow
版权声明:本文标题:javascript - backbonejs view without a model - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742007703a2412293.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论