Angular - Directives
What will happen when this directive is applied?
@Directive({ selector: '[appClick]' })
export class ClickDirective {
constructor(private el: ElementRef) {
this.el.nativeElement.addEventListener('click', () => alert('Clicked!'));
}
}Applied as: <button appClick>Press</button>
