From AngularJS to Angular
AngularJS was released in 2010 as one of the first modern front-end frameworks. It came to market in 2010 and rapidly grew popular with developers. Among the features that grew popular with developers were dependency injection, routing, and two-way data binding. It significantly changed how front-end developers wrote code.
Support by Google for AngularJS (1.x) was discontinued in January 2022 and migrating to the newer Angular (2.x) is highly recommended.
The MVC Pattern
Angular uses the model-view-controller (MVC) pattern for structuring the code into the following three sections:
- The model represents the data that may eventually be stored in a database and used to populate a web page.
- The view represents the model data in an interface to be seen and interacted with by the user.
- The controller contains the logic for the web application and connects the model data with the views.
Routing and Binding
Single page applications (SPAs) are built with Angular and feature a URL that doesn’t require a page reload to function. Angular uses routing to map the URL in the web browser to a specific state in the web application.
Angular also uses two-way data binding to inherently link the views and model data with one another. Updates in one causes updates in the other. This allows for data to be readily shared between components throughout the application.