Wrapping Up

In this section we covered how to create a custom directive.

We learned:

  • That components are directives, but directives with views and templates.

  • How to define a directive with the @Directive decorator.

  • How to listen to the output events and bind to the input properties of a host element from within a directive.

  • How to configure a directive to make it more re-usable.

Caught a mistake or want to contribute to the book? Edit this page on GitHub!

Learn Angular For FREE

I've released my 700 page Kick Starter funded Angular book for FREE