Sunday 28 January 2018

AngularJS Life Cycle

AngularJS Life Cycle

Since you comprehend the segments engaged with an AngularJS application, you have to comprehend what occurs amid the life cycle, which has three stages: bootstrap, arrangement, and runtime. Understanding the life cycle of an AngularJS application makes it less demanding to see how to outline and actualize your code.
 
The three periods of the life cycle of an AngularJS application happen each time a site page is stacked in the program. The accompanying areas depict these periods of an AngularJS application.
 
1- Bootstrap
2- Compilation
3- Data Binding
 
1-Bootstrap 
 The primary period of the AngularJS life cycle is the bootstrap stage, which happens when the AngularJS JavaScript library is downloaded to the program. AngularJS instates its own vital segments and after that introduces your module, which the ng-application order focuses to. The module is stacked, and any conditions are infused into your module and made accessible to code inside the module.
 
2- Compilation
The second period of the AngularJS life cycle is the HTML aggregation arrange. At first when a page is stacked, a static type of the DOM is stacked in the program. Amid the aggregation stage, the static DOM is supplanted with a dynamic DOM that speaks to the AngularJS see.
This stage includes two sections: navigating the static DOM and gathering every one of the orders and after that connecting the orders to the suitable JavaScript usefulness in the AngularJS worked in library or custom mandate code. The orders are joined with an extension to create the dynamic or live view.
 
3- Data Binding
 
The last period of the AngularJS application is the runtime stage, which exists until the point when the client reloads or explores far from a site page. By then, any adjustments in the degree are reflected in the view, and any adjustments in the view are specifically refreshed in the extension, making the degree the single wellspring of information for the view.
AngularJS carries on uniquely in contrast to conventional strategies for restricting information. Conventional strategies join a format with information got from the motor and after that control the DOM each time the information changes. AngularJS arranges the DOM just once and afterward connects the aggregated layout as fundamental, making it considerably more proficient than customary techniques.

1 comment: