Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
MVC javascript中M中的模型和简单对象有什么区别?
谢谢!
模型是一种特定类型的类或对象,旨在与您的特定站点或软件的数据集进行交互。它通常还包括旨在简化访问数据过程的方法。
简单地说:“模型”是用于处理数据的特定且集中的对象类型。
正如XMO所说。
例如:您在“Yourapp.Models”中有一个模型“Foo”。所以你可以在任何控制器中监听模型的“create”方法:
"{Yourapp.Models.Foo} created": function () {} ...
您无法使用普通对象轻松实现此目的。