1 - About Angular JS

AngularJS - commonly called Angular.js or AngularJS 1-, is an open-source JavaScript framework, maintained by Google, which is used to create and maintain web applications. Its goal is to increase browser-based applications with Model View Controller (MVC) capability, in an effort to make development and testing easier.

The library reads the HTML that contains attributes of the additional custom tags, then obeys the directives of the custom attributes, and joins the input or output pieces of the page to a model represented by the standard JavaScript variables. The values of JavaScript variables can be manually configured, or retrieved from static or dynamic JSON resources.

AngularJS can be combined with the Node.js runtime environment, the Express.js server framework and the MongoDB database to form the MEAN set.

2 - Philosophy of Angular

AngularJS is based on the idea that declarative programming must be used to build user interfaces and cabling software components, while imperative programming excels at expressing business logic5. The design of Angular is guided by several objectives:

Decouple DOM manipulations from business logic. This improves the testability of the code;
Consider the test of an application as important as writing the application itself. The difficulty of the test phase is significantly impacted by the way the code is structured;
Decouple the client and server sides of an application. This allows software development of the client and server sides to progress in parallel, and allows the reusability of each side;
Guiding developers for the duration of an application's construction: from designing the user interface, writing business logic to testing the application;
Make easy tasks easy and difficult tasks possible.

3 - Design

A web page designed with AngularJS follows the MVC (model-view-controller) architecture pattern. This boss has the advantage of offering a weak coupling between the presentation, the data, and the business components. In a web language, this separation makes it possible to reduce the importance of the DOM manipulations and to improve the testability of the code.

In AngularJS, the "view" part is declared in an extended version of traditional HTML, which includes new tags and attributes. This extended HTML is used to declare a bidirectional data link between models and views. Thus, the data is synchronized automatically, and fewer elements need to be defined in Javascript. The models are composed of several layers called "scopes". Controllers in AngularJS allow prototyping actions in native JavaScript code.

By offering dependency injection, Angular provides client-side web applications with traditional server-side services such as view controllers. As a result, much of the burden on the backend is removed, leading to much lighter web applications on the server side.

Moreover, AngularJS has the distinction of using (promised) promises, taken from the Q language. A promise is an asynchronous operation (it does not block the execution of the rest of the program) which will send its final result to a function of reminder as soon as it is known.6

4 - Operation

Automatic synchronization of data between the model and the view is enabled by a mechanism called dirty-checking. AngularJS continuously runs a loop that consists of monitoring and detecting changes on a JavaScript object.

AngularJS ships a subset of the jQuery open source library called jQLite, but can also use jQuery if it is loaded7.

Younes Derfoufi
One thought on “Presentation of AngularJS”

Leave a Reply