In this chapter, we covered almost all aspects of directive building. We built all sorts of directives, from the trivial ones to the seemingly more complex ones. We created directives that just extended behavior and ones that came with their own template and behavior.
You learned how the complete directive configuration can be controlled by a directive definition object.
When building directives, we explored the compile and link phase of directive execution. Together with controller
function, the compile
and link
function provide extension points to implement directive behavior.
We also covered two interesting services the $compile
and $parse
service. We utilized $compile
to compile dynamic html fragments and the $parse
service to evaluate AngularJS expression.
You learned how a directive can control scope creation using the scope
property. We also created directives with isolated scope that allow us create really reusable components in AngularJS.
Finally, we looked at some integration...