O'Reilly logo

AngularJS Directives by Alex Vanston

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 6. Controllers – Better with Sharing

In Chapter 4, Compile versus Link, we walked through the compile and link steps of the Angular compilation process. What we set aside, at that point, were controllers, which are also functions that execute as Angular applies a directive. In and of themselves, controllers don't provide significant advantages over local methods within the linking function of your directives. When paired with their ability to be shared across directives, however, controllers provide unparalleled communication between directives on the same node, or even just within the same ancestral tree. To get a better understanding of how these controllers can enable directives to work together, let's take a look at the ngModel and ...

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