component directives in angular code example Example: user defined directives in angular 7 import { Directive, ElementRef } from '@angular/core';