angularjs - MVW 代表什么?

标签 angularjs acronym mvw

这是 AngularJS 页面的内容描述:

AngularJS is what HTML would have been, had it been designed for building web-apps. Declarative templates with data-binding, MVW, MVVM, MVC, dependency injection and great testability story all implemented with pure client-side JavaScript!

那么 MVW 代表什么? (考虑到 MVC、MVVW、MVP 等争论,我猜“随便”,模型- View -随便 =P)

最佳答案

它确实代表任何东西,如whatever works for you根据 2012 年 Igor Minar 的说法(强调我的):

MVC vs MVVM vs MVP. What a controversial topic that many developers can spend hours and hours debating and arguing about.

For several years +AngularJS was closer to MVC (or rather one of its client-side variants), but over time and thanks to many refactorings and api improvements, it's now closer to MVVM – the $scope object could be considered the ViewModel that is being decorated by a function that we call a Controller.

Being able to categorize a framework and put it into one of the MV* buckets has some advantages. It can help developers get more comfortable with its apis by making it easier to create a mental model that represents the application that is being built with the framework. It can also help to establish terminology that is used by developers.

Having said, I'd rather see developers build kick-ass apps that are well-designed and follow separation of concerns, than see them waste time arguing about MV* nonsense. And for this reason, I hereby declare AngularJS to be MVW framework - Model-View-Whatever. Where Whatever stands for "whatever works for you".

Angular gives you a lot of flexibility to nicely separate presentation logic from business logic and presentation state. Please use it fuel your productivity and application maintainability rather than heated discussions about things that at the end of the day don't matter that much.

关于angularjs - MVW 代表什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13329485/

相关文章:

javascript - 如何使用 Protractor 清除 type=date 的输入

javascript - AngularJS 传递范围?

qt - Qt 代表什么?

javascript - 你应该如何在 AngularJS 中定义常规函数

javascript - 比较 Angularjs 中两个数组之间的对象

javascript - 如何在 AngularJS 中将数据从父级发送到子级

.net - .NET 代表什么?它是缩写吗?

algorithm - ZIP 代表什么(压缩格式,不是邮政编码)

javascript - aurelia View 中的过滤器数组