CHAPTER 5

image

Directives

Most JavaScript frameworks have a “special something” that sets them apart. That special something in the case of AngularJS is undoubtedly directives. The idea that we can use a declarative approach that lets us augment HTML with new capabilities has great appeal. I suspect this has very much to do with clean looks and intuitive syntax, but it might be because it is a fun and enjoyable way to approach client-side web development.

In this chapter, I will recap some of the things we have already been using, by looking at the built-in directives. You will also have a first look at creating custom directives.

Directives, in Angular ...

Get Beginning AngularJS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.