top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How AngularJS is compiled?

0 votes
329 views
How AngularJS is compiled?
posted Oct 16, 2017 by Sathaybama

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Angular's HTML compiler allows you to teach the browser new HTML syntax. The compiler allows you to
attach new behaviors or attributes to any HTML element. Angular calls these behaviors as directives.
AngularJS compilation process takes place in the web browser; no server side or pre-compilation step is involved.
Angular uses $compiler service to compile your angular HTML page. The angular' compilation process begins after
your HTML page (static DOM) is fully loaded. It happens in two phases:
1. Compile - It traverse the DOM and collect all of the directives. The result is a linking function
2. Link - It combines the directives with a scope and produces 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.
The concept of compile and link comes from C language, where you first compile the code and then link it to
actually execute it. The process is very much similar in AngularJS as well.

answer Oct 16, 2017 by Shivaranjini
...