MVC, MVA, MVP, MVVM?

Angular 1 (AngularJS) was called an MVW-Framework. MVW stands for Model-View-Whatever. Is Angular 2 still MVW?

Is MVW the same as MV*?

I know that Whatever means that it could be a ViewModel or a Controller. Model and View is still the same.

But can MVW also mean that there is a Presenter or an Adapter?

I know that the Model can be factories or services, the controller is the component class and the view is the component template (template or templateUrl), if I use the MVC pattern. The Service can be used via Dependecy Injections in the class constructor of my component file. The member variables can be set there. The view binds the member variables.

I am not sure, but the ViewModel is also the component class. But I don't understand the difference in Angular 2, because I couldn't find any examples for MVC or MVVM.

  • At first I want to know if Angular 2 is also MVW?
  • Then is MVW the same as MV*?
  • After that is there a person who know a good example which shows the code difference between MVC and MVVM.

  • If Angular 2 also support Presenter or Adapter, are there any good code examples for this two pattern?

  • I think the theory behind these concepts I have understood really well, but I can't find code examples or clear answers how you can use these patterns. Also I can'f find a clear answer If Adapter and Presenter is also supported by Angular 2.

    These links can help: Angular2: MVC, MVVM or MV*?

    How MVC pattern can be explained in Angular 2?

    But it's all theory and no practice.

    In the documentation (angular.io) I only can found these two statements:

    The Angular application manages what the user sees and can do, achieving this through the interaction of a component class instance (the component) and its user-facing template.

    You may be familiar with the component/template duality from your experience with model-view-controller (MVC) or model-view-viewmodel (MVVM). In Angular, the component plays the part of the controller/viewmodel, and the template represents the view.

    or this

    An Angular class responsible for exposing data to a view and handling most of the view's display and user-interaction logic.

    The component is one of the most important building blocks in the Angular system. It is, in fact, an Angular directive with a companion template.

    Apply the @Component decorator to the component class, thereby attaching to the class the essential component metadata that Angular needs to create a component instance and render the component with its template as a view.

    Those familiar with "MVC" and "MVVM" patterns will recognize the component in the role of "controller" or "view model".

    I am really confused about this topic. I hope there is a person who can help me.

    On this link there is a similar question to MVW. Is the shown example a vaild example for MVC? What does MVW stand for in Angular2?

    链接地址: http://www.djcxy.com/p/63372.html

    上一篇: VPN没有连接变化?

    下一篇: MVC,MVA,MVP,MVVM?