0

Recently I am going through concept of Custom Directives. When I was looking into deep of concepts I found few terminologies like

$compile -> Which traverse through DOM and find its directives $tansclude -> Which is used to load template to another template. Its value is either true or false. Controller -> Which is used to bind the DOM elements to $scope. This works before compilation Link -> Which is used to link or bind data. This is done after DOM compilation.

How these are related to each other. What happens when we set transclude to false or true. When to use controller or link. How compiler is relates these functions. Is there is compulsory on using transclude. What is pre-link and post-link.

user3335796
  • 1,227
  • 1
  • 17
  • 24
  • This is much too broad. Read the official documentation on directives: https://docs.angularjs.org/guide/directive, https://docs.angularjs.org/api/ng/service/$compile – JB Nizet Apr 06 '16 at 07:27
  • I have studied these concept from above links only but i am not getting clear picture of it – user3335796 Apr 06 '16 at 07:36
  • Compile vs Link: http://stackoverflow.com/questions/12164138/what-is-the-difference-between-compile-and-link-function-in-angularjs Transclude: http://stackoverflow.com/questions/15296284/understanding-the-transclude-option-of-directive-definition Compile vs Link vs controller : http://stackoverflow.com/questions/24615103/angular-directives-when-and-how-to-use-compile-controller-pre-link-and-post Explanations already exists, just use google :) – Aliz Apr 06 '16 at 08:39

0 Answers0