Is angular MVVM or MVC?
I'll answer
Earn 20 gold coins for an accepted answer.20
Earn 20 gold coins for an accepted answer.
40more
40more

Julian Gonzales
Works at the World Bank, Lives in Washington, D.C., USA.
Hello, I'm an expert in web development frameworks, and I'd be glad to help you understand the architectural patterns of Angular and AngularJS.
Angular is a platform and framework for building client-side applications. It was originally developed by Misko Hevery and others at Google in 2009. Angular is a complete rewrite from the ground up, which is also why it's often referred to as Angular 2+ to distinguish it from the original AngularJS framework.
AngularJS, the original framework, is primarily considered an MVC (Model-View-Controller) framework. In MVC, the model represents the data of the application, the view is the visualization of the data, and the controller acts as an intermediary between the model and the view, handling the data and user input.
However, AngularJS can also be adapted to work in a pattern similar to MVVM (Model-View-ViewModel). MVVM is a design pattern that facilitates the separation of the user interface (UI) and business logic. It's particularly popular in the world of mobile development and is a key pattern used by frameworks like Microsoft's WPF and Silverlight, as well as in some JavaScript frameworks.
The key difference between MVC and MVVM is the ViewModel. In MVVM, the ViewModel is a representation of the model that is exposed to the view. It acts as a bridge between the view and the model, and it can contain logic that is not directly related to the UI. This can make the ViewModel a more complex and powerful component than the controller in MVC.
AngularJS provides a scope in its MVC pattern that can be used similarly to a ViewModel in MVVM. This scope can bind data and functions to the view and can handle data transformations and business logic. So, while AngularJS is primarily an MVC framework, developers familiar with MVVM can leverage AngularJS's scope to mimic the MVVM pattern.
Now, let's move on to Angular 2+, which is a complete departure from AngularJS in terms of its architecture. Angular 2+ adopts a component-based architecture that is more aligned with the modern web development practices. It uses a system of components and directives to build applications. Each component is a self-contained piece with its own view and change detector, and it can interact with other components through inputs and outputs.
In Angular 2+, the role of the ViewModel is somewhat abstracted and distributed across several parts of the framework. The `@Component` decorator serves as a way to define a ViewModel-like structure, encapsulating the template, the class that provides data and behavior, and the metadata that describes how the component should be processed.
Angular 2+ also uses services to handle business logic and data management, which can be shared across components. This is somewhat analogous to the model in MVC or MVVM, but it's decoupled from the view and the component logic.
To summarize, AngularJS is primarily an MVC framework but can be adapted to function in an MVVM-like manner. Angular 2+, on the other hand, uses a component-based architecture that is different from both MVC and MVVM, although it shares some conceptual similarities with both.
Now, let's proceed with the translation as requested.
Angular is a platform and framework for building client-side applications. It was originally developed by Misko Hevery and others at Google in 2009. Angular is a complete rewrite from the ground up, which is also why it's often referred to as Angular 2+ to distinguish it from the original AngularJS framework.
AngularJS, the original framework, is primarily considered an MVC (Model-View-Controller) framework. In MVC, the model represents the data of the application, the view is the visualization of the data, and the controller acts as an intermediary between the model and the view, handling the data and user input.
However, AngularJS can also be adapted to work in a pattern similar to MVVM (Model-View-ViewModel). MVVM is a design pattern that facilitates the separation of the user interface (UI) and business logic. It's particularly popular in the world of mobile development and is a key pattern used by frameworks like Microsoft's WPF and Silverlight, as well as in some JavaScript frameworks.
The key difference between MVC and MVVM is the ViewModel. In MVVM, the ViewModel is a representation of the model that is exposed to the view. It acts as a bridge between the view and the model, and it can contain logic that is not directly related to the UI. This can make the ViewModel a more complex and powerful component than the controller in MVC.
AngularJS provides a scope in its MVC pattern that can be used similarly to a ViewModel in MVVM. This scope can bind data and functions to the view and can handle data transformations and business logic. So, while AngularJS is primarily an MVC framework, developers familiar with MVVM can leverage AngularJS's scope to mimic the MVVM pattern.
Now, let's move on to Angular 2+, which is a complete departure from AngularJS in terms of its architecture. Angular 2+ adopts a component-based architecture that is more aligned with the modern web development practices. It uses a system of components and directives to build applications. Each component is a self-contained piece with its own view and change detector, and it can interact with other components through inputs and outputs.
In Angular 2+, the role of the ViewModel is somewhat abstracted and distributed across several parts of the framework. The `@Component` decorator serves as a way to define a ViewModel-like structure, encapsulating the template, the class that provides data and behavior, and the metadata that describes how the component should be processed.
Angular 2+ also uses services to handle business logic and data management, which can be shared across components. This is somewhat analogous to the model in MVC or MVVM, but it's decoupled from the view and the component logic.
To summarize, AngularJS is primarily an MVC framework but can be adapted to function in an MVVM-like manner. Angular 2+, on the other hand, uses a component-based architecture that is different from both MVC and MVVM, although it shares some conceptual similarities with both.
Now, let's proceed with the translation as requested.
2024-05-14 14:01:09
reply(1)
Helpful(1122)
Helpful
Helpful(2)
Works at Airbnb, Lives in San Francisco.
However, AngularJS is primarily MVC framework, as it brings views and controllers out of the box. ... Because of this, it can be called Model in MVC architecture. If you are coming from world of mobile devices, and you are familiar with MVVM pattern, you can easily use AngularJS and keep working as you are used to.Apr 28, 2016
2023-06-18 16:27:55

Charlotte Martin
QuesHub.com delivers expert answers and knowledge to you.
However, AngularJS is primarily MVC framework, as it brings views and controllers out of the box. ... Because of this, it can be called Model in MVC architecture. If you are coming from world of mobile devices, and you are familiar with MVVM pattern, you can easily use AngularJS and keep working as you are used to.Apr 28, 2016