AngularJS is a structural framework for dynamic web applications.
It lets you use HTML as your template language and lets you extend HTML’s syntax to express your application’s components clearly and succinctly. AngularJS’s data binding and dependency injection eliminate much of the code you would otherwise have to write. And it all happens within the browser, making it an ideal partner with any server technology.
- Handles the heavy lifting of DOM manipulation and AJAX glue that once had to be coded from scratch
- Can be added to any HTML page with a <script> tag
HOW ANGULARJS APPLICATION LOADS?
AngularJS application gets initialized when DOMContentLoaded events gets fired.A DOMContentLoded event is fired on the document when all the HTML elements are loaded and parsed.It does not wait for all the resources like images,styles and other to be downloaded to browser.Once this event is fired Angular executes the below steps.
- Angular looks for ngApp directives in the DOM tree. ngApp works like a marker to AngularJS, which tells the AngularJS that the portion of HTML markup needs compilation.
- If Angular finds multiple ngApp directives then it takes the 1st ngApp covered HTML portion and starts the process of auto-bootstrapping.In auto-bootstrapping all other depended modules and injectors gets loaded to the AngularJS application.
- The other remaining ngApp directives needs manual bootstrapping.A manual bootstrapping can be done using angular.bootstrap() method.
Once the ngApp root is determined the compilation process of HTML markup gets triggered by considering the ngApp element as the root of the application.During the compilation process it loads all the dependencies like injector or modules.