O'Reilly logo

AngularJS: Novice to Ninja by Sandeep Panda

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10AngularJS Directives

The Directive API is one of the coolest features of AngularJS. Now that you've been developing in AngularJS for some time, you've come across many simple directives, such as ng-repeat, ng-show, ng-model, etc. But when you come to develop real world apps you'll most likely need custom directives. This chapter will teach you how to build these and implement them in our demo app.

What Are Directives, Really?

A directive is something that attaches special behavior to a DOM element and teaches it awesome tricks! Let's take the example of the built-in ng-repeat directive: What this does is attach special behavior to a DOM element by repeating it multiple times. Similarly, ng-show and ng-hide conditionally show or hide ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required