Custom Directives in Angular
A few built in directive include ng-app, ng-view, ng-repeat, ng-if, and all the other ng-somethings are examples of Angular’s built-in directives. Directives enhance HTML to do special things that cannot be done with plain ol’ HTML. For instance, adding the
ng-if attribute to an HTML element will conditionally render that element if its expression evaluates to true. Likewise, adding the
ng-repeat attribute will repeat an HTML element for items in an array. These types of programming features, control flow and looping, aren’t inherent parts of HTML. Directives add these extra super powers to your markup. Along with built-in directives, Angular allows you to create custom directives which can make up a large portion of your Angular JS application.
November 10, 2015