Benefits of AngularJS

Akash singh
3 min readJan 1, 2021

1. It’s not a javascript library. There are no functions which we can directly call and use.

2. It is not a DOM manipulation library like jquery. But it uses a subset of jQuery for DOM manipulation.

3. Focus more on the HTML side of web apps.

4. For MVC/MVVM design pattern.

5. AngularJS is a JavaScript MVC framework created by Google to build properly architecture and maintainable web applications.

Key features of Angular JS:-

• Declarative HTML approach

• Easy Data binding: two-way data binding

• Reusable Components

• MVC/MVVM Design pattern

• Dependency Injection

• End to end integration testing/unit testing

• Routing

• Templating

• Modules

• Services

• Expressions

• Filters

• Directives

• Form validation

• Scope

Model View Controller

a) Model — the data

b) View — the user interface, what the user sees and interact with

c) Controller — the interface between the model and the view

The model is not necessarily the data from the database.

The browser, server, and database can have their own MVC systems and often do.

When we talk about the MVC in this presentation we’ll be talking about the MVC on the browser.

MVVM supports two-way data binding between view and view model. This enables automatic propagation of changes, within the state of view model to the view. The view model uses the observer pattern to notify changes in the view model to model.

HTML COMPILER

Angularjs HTML compiler allows the developer to teach the browser new HTML syntax. The compiler allows you to attach behaviour to any HTML element or attribute and even create new HTML elements or attributes with custom behaviour. Angular calls these behaviour extensions directives. The compiler is an angular service which traverses the DOM looking for attributes. The compilation process happens in two phases.

• Compiler: traverse the DOM and collect all of the directives. The result is a linking function.

• Link: Combine the directives with a scope produce a live view. Any changes in the scope model are reflected in the view, and any user interactions with the view are reflected in the scope model. This makes scope model the single source of truth.

Directive

It is a maker on an HTML element (such as an attribute, element name, comment, or CSS class)that angularjs recognizes and uses to create a customized set of functionality and/or user interface.

Angularjs comes with many pre-built directives, but you can also write your own custom directives.

Modules

A module can be an application, or it can be a collection of components that can be injected into other modules. In Angular, that’s the way you group related things together so you can benefit from its dependency injection system.

You can think of a module as a container for the different parts of your app — controllers, services, filters, directives, constant, value, factory, provider, etc.,

Scope

A scope is an object that refers to the application model. It is an execution context for expressions. Scopes are arranged in a hierarchical structure. Scopes can watch expressions and propagate events. Actually the view model of MVVM.

Dependency Injection

It is a software design pattern that deals with how components get hold of their dependencies.

The AngularJS injector subsystem is in charge of creating components, resolving their dependencies, and providing them to other components as requested.

--

--