Run the below command to generate angular directive in the project directory
ng generate directive {directive-name}
or
ng g d {directive-name}
The below example shows creating a directive with name as button.
The reference is also updated in app.module.ts.
Awesome…