O'Reilly logo

Mastering Web Application Development with AngularJS by Pawel Kozlowski, Peter Bacon Darwin

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

Taking control of the compilation process

There are some situations where we need to have more control over how AngularJS compiles and links an element and its children. Perhaps we wish to load the directive's template dynamically or we want more control over the transclusion of elements into a directive's template. In these cases we can terminate the compilation process then modify and compile the directive's element and children manually.

Creating a field directive

When writing applications that use forms, it quickly becomes apparent that there is a lot of duplication and redundancy in the amount of boilerplate HTML requires for each field on the form.

For instance, and for every field there will be an input element and a label element surrounded ...

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