In this chapter we looked at a variety of common patterns for defining, testing, and implementing directives. We saw how to integrate with the
ngModel to implement validation, how to write a reusable encapsulated widget, and how to wrap a third party widget in an AngularJS directive. Throughout the chapter testing has been promoted and we looked at common strategies for testing directives in AngularJS.
In the next chapter we will take a deeper look into building directives, looking at some of the more advanced features such as transclusion, and compiling our own templates.