O'Reilly logo

Mastering AngularJS Directives by Josh Kurz

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

Using scope objects for communication

Communication between directives can be by means of many different interactions. The most common and easy to achieve is to use the common $scope object. This is usually the first form of communication developers use when writing directives that communicate with each other.

When writing directives that communicate and use model objects, it is recommended to follow certain development ideologies related to code organization and declaration. The following are the two major related AngularJS ideologies that should always be implemented when writing directives, to create the most extendable and readable code base:

  • Declaratively define what variables a directive watches as an attribute
  • Avoid forcing directives to write ...

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