Angular directives – when and how to use compile, controller, pre-link and post-link [closed]
In which order the directive functions are executed? For a single directive Based on the following plunk, consider the following HTML markup: <body> <div log=’some-div’></div> </body> With the following directive declaration: myApp.directive(‘log’, function() { return { controller: function( $scope, $element, $attrs, $transclude ) { console.log( $attrs.log + ‘ (controller)’ ); }, compile: function compile( tElement, … Read more