© Mark Clow 2018
Mark ClowAngular 5 Projectshttps://doi.org/10.1007/978-1-4842-3279-8_11

11. Introducing Directives

Mark Clow1 
(1)
Sandy Springs, Georgia, USA
 

Directives are markers on a DOM element (such as an attribute) that tell Angular to attach a specified behavior to an existing element.

Directives have been around since AngularJS. They’re quite complex to use, though they’re a lot easier to use in Angular, especially when it comes to passing data into directives. Directives used to be the main way of creating custom tags in an AngularJS application; now that’s been replaced by directives and components.

Angular itself provides many directives to help you in your coding. You can also code your own.

As Chapter 8 stated, components have three ...

Get Angular 5 Projects: Learn to Build Single Page Web Applications Using 70+ Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.