Basically, a directive is a function that is executed once the AngularJS compiler finds it within the DOM. These functions will do nearly anything and that is why it is hard to define what a directive is. Every directive contains a name (such as
ng-repeat, tabs, your-own-directive) and every directive determines where it is used, such as in DOM elements, or an attribute, or a class. For example,
<copyright> </copyright> where
copyright is an AngularJS directive.
AngularJS directives usually contain a post-link function that links directives to the element's children. A sophisticated directive may have a compile function, prelink function, and post-link function. Directives are used anywhere that you deploy the DOM and catch ...