加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – MVW是什么意思?

发布时间:2020-12-17 09:37:00 所属栏目:安全 来源:网络整理
导读:这里是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 p
这里是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等争用,我会猜测“不管”,Model-View-Whatever = P)

它确实为什么,如在 whatever works for you

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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读