Directives are a way to teach HTML new tricks. During DOM compilation directives are matched against the HTML and executed. This allows directives to register behavior, or transform the DOM.
Directives can be used to create custom HTML tags that serve as new, custom widgets. They can also be used to “decorate” elements with behavior and manipulate DOM attributes in interesting ways.
First We need to Add AngularJS Library , and add reference on our Index.html Page . Index.html page code looks like below :::
Here We can see is not an HTML tag , but we can create a custom HTML tag easily by using AngularJS Directive.
Here is my AngularJS code of MyDirective.js :::