How AngularJS is compiled?

Answers were Sorted based on User's Feedback



How AngularJS is compiled?..

Answer / chaitanya

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.

30

www.webgeekschool.com www.dotnet-tricks.com

To Join .NET, ASP.NET MVC, WCF, AngularJS, Mobile Development Training Programs - Call Us : +91-9871749695

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.

Is This Answer Correct ?    1 Yes 0 No

How AngularJS is compiled?..

Answer / ramyagurrala

Compiler is an Angular service which traverses the DOM looking for attributes.
The compilation process happens in two phases.

Compile: traverse the DOM and collect all of the directives.

Link: combine the directives with a scope and produce a live view.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More AngularJS Interview Questions

What are the differences between observables & promises?

0 Answers  


What is $emit, $broadcast and $on in AngularJS?

0 Answers  


What sre the directives in angularjs?

0 Answers  


What is the life cycle event to check whether the dom is fully loaded?

0 Answers  


Explain what are the key features of angular.js ?

0 Answers  






What are the modules in angularjs?

0 Answers  


Why do we need custom directives in angular?

0 Answers  


What is primeng and how can it be used with angular2?

0 Answers  


What's new in angular 6?

0 Answers  


What is ngonchanges in angular 2?

0 Answers  


Can you write both angular 1 and angular 2 codes in a single project?

0 Answers  


What is the use of canactivate in angular?

0 Answers  


Categories