Chapter 9. Building Advanced Directives

The previous chapter introduced how to develop and test your own custom directives. In this chapter we look at some of the more advanced things that you can do when developing AngularJS directives. This will include:

  • Understanding transclusion: in particular use of transclusion functions and transclusion scopes
  • Define your own directive controllers to create directives that can cooperate, and how these controllers differ from link functions
  • Terminating the compilation process and taking control: loading your own templates dynamically and using the $compile and $interpolate services

Using transclusion

When you move elements from one part of the DOM to another, you have to decide what happens to their associated ...

Get Mastering Web Application Development with AngularJS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.