MVC structure in AngularJS
Model View Controller or more commonly known as MVC, is a software design model for web-based applications. A Model View Controller is made up of 3 main parts:
- Model - The lowest component of the model is responsible for maintaining data.
- View - Is responsible for displaying the data to the user.
- Controller - Is the Code section that controls the interaction between Model and View
MVC is more popular because it separates the application logically between the user interface layer and supporting related parts. The controller part receives all requests for the application and then works with the model part to prepare the data for the view. The view uses the data prepared by the controller and then creates the data seen by the user.
- Model component in AngularJS: Model component for data management task. It responds to requests from the view and executes commands from the controller to update values for itself.
- The View component in AngularJS: Is the component that displays the data in a specific format, triggered by the controller section to display the data.
- Controller component in AngularJS: Controller component interacts with user data and executes changes on model object. The controller part takes the input parameters, makes the parameters take effect, then performs logic operations in which the model data state can be changed.
AngularJS is a working framework based on MVC model. In the following chapters, we will see how AngularJS uses the MVC method.
According to Tutorialspoint
Previous lesson: Instructions for installing AngularJS
Next lesson: Create the first AngularJS application
You should read it
- Instructions for installing AngularJS
- View components in AngularJS
- What is AngularJS?
- The Service in AngularJS
- Directive in AngularJS
- The Filter in AngularJS
- The Module in AngularJS
- Ajax in AngularJS
- Form in AngularJS
- Controller component in AngularJS
- HTML DOM element in AngularJS
- Create the first AngularJS application
Maybe you are interested
Top 7 best vertical mouse models worth owning in 2024
Apple adds several iPhone and Watch models to its obsolete product list
Series of DrayTek router models have security holes
Pixel 9's new AI features could soon expand to older models
Why should you buy the base iPhone 16 instead of the Pro model?
Top 6 smart ring models today