What is AngularJS?
AngularJS is a JavaScript based open-source framework developed by Google. It is the predecessor to Angular.
It's use has become less and less prevalent over the years because there has been a shift to the more modern Angular. That means, improvements and updates to AngularJS have been few and far between and whilst still a functional framework, it is not usually the number one choice for developing business applications.
Here, we look at some of the core features of AngularJS.
Key features of AngularJS
MVC Architecture -
- Model - Manages the data of the application.
- View - Displays the data (UI).
- Controller - Connects the Model and the View, controlling the data flow into the model object and updates the view whenever data changes.
Directives -
- HTML Extensions - Extend HTML with custom attributes and elements.
- Reusable Components - Developers can create reusable components using directives.
Dependency Injection -
- AngularJS has a built-in dependency injection mechanism that helps in making applications modular, maintainable and testable.
Two Way Data Binding -
- AngularJS supports two way data binding. This means it automatically syncs data between the model and the view components.
Routing -
- Allows the creation of SPAs (single-page applications) with multiple views which are handled by the ngRoute module.
Templating -
- Uses HTML to define the user interface of the application which AngularJS processes using the template engine.
Filtering -
- Change data displayed in the view (e.g., format dates, currency, limit items in a list).
Modularity -
- Applications can be divided into modules which in turn, makes the code more manageable and organised.
Testing -
- Provides support for unit and end-to-end testing with tools such as Jasmine and Protractor.
To Conclude -
Despite being succeeded by Angular, AngularJS is still a useable framework for building dynamic web applications with a focus on single-page applications. There are still many AngularJS applications in use and there likely will be for some years either due to the complexity or cost to change.