How to create a Directive in Angular 9

In this article we will learn how to create a directive and use it in Angular 9.

It has been said that directives are perhaps the most important bit of an Angular application. As a matter of a fact one of the most-used Angular unit, the component, is actually a directive.

According to Angular 9 documentation on attribute directive there are three kinds of directives in Angular:

  1. Components — directives with a template.
  2. Structural directives — change the DOM layout by adding and removing…