vue.js - What is the difference between ViewModel and Controller?
習慣沉默
習慣沉默 2017-05-16 17:05:24
0
2
649

vue.js belongs to the MVVM framework, and angularjs belongs to the MVC framework, right? What's the difference between them in this aspect?
What is the difference between VM in MVVM and C in MVC framework?

習慣沉默
習慣沉默

reply all(2)
小葫芦

Simply put, the tasks that the Controller has to perform are more comprehensive, including a lot of business logic. The ViewModel simplifies or even eliminates the business logic. The main job is just to assemble the data in the Model into data suitable for use by the View.
Compared to Vue, Angular is indeed an MVC framework. In fact, for the front-end, little or no business logic is required, so the back-end design structure of MVC is actually not suitable. Therefore, structures such as MVP and MVVM that weaken business logic are becoming more and more popular in the front-end field.

漂亮男人

MVC
Routing to the controller, the controller needs to process the model (data) by itself, and then re-render to generate the view (UI)

MVVM
Data-driven, once the model changes, its view (UI) will change.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template