Nitin Choudhary
Explain what is the difference between link and compile in angular.js?
By Nitin Choudhary in Angular on Jan 20 2015
  • Nitin Choudhary
    Jan, 2015 20

    Compile function: It is used for template DOM Manipulation and collect all of the directives. Link function: It is used for registering DOM listeners as well as instance DOM manipulation. It is executed once the template has been cloned.

    • 1
  • Bhuvanesh Mohankumar
    May, 2016 19

    Compile: traverse the DOM and collect all of the directives. The result is a linking function.Link: combine the directives with a scope and produce 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. Making the scope model a single source of truth.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS