Javascript MVC:对象与模型
MVC javascript 中的 M 模型和简单对象有什么区别?
谢谢你!
What is the difference between a model as in the M in MVC javascript, and a simple object?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
模型是一种特定类型的类或对象,旨在与特定站点或软件的数据集进行交互。它还通常包括旨在简化访问数据过程的方法。
简单地说:“模型”是一种特定且集中的对象类型,旨在处理数据。
A model is a specific type of class or object that is designed to interact with the data sets of your particular site or software. It also usually includes methods designed to simplify the process of accessing the data.
Simply: A "MODEL" is a specific and focused type of object meant to deal with data.
确实如XMO所说。
例如:
您在“Yourapp.Models”中有一个模型“Foo”。
因此,您可以在任何控制器中侦听模型的“创建”方法:
您无法使用普通对象轻松实现此目的。
It is exactly as XMO said.
For Example:
You have a Model "Foo" in "Yourapp.Models".
So you could listen in any controller to the model's method "create" with:
You can not achieve this that easily with a normal object.