Building our own custom directives

Custom directives encompass a vast world of possibilities and use cases, and we would need an entire book for showcasing all the intricacies and possibilities they offer.

In a nutshell, directives allow you to attach advanced behaviors to elements in the DOM. If a directive has a template attached, then it becomes a component. In other words, components are Angular directives with a view, but we can build directives with no attached views that will be applied to already existing DOM elements, making its HTML contents and standard behavior immediately accessible to the directive. This applies to Angular components as well, where the directive will just access its template and custom attributes and events when necessary.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset