Last active
November 13, 2019 14:37
-
-
Save nhamilakis/eb178344c9f1d61b3ec2056605e423f0 to your computer and use it in GitHub Desktop.
Block Click Events in Angular
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Directive, HostListener} from '@angular/core'; | |
@Directive({ | |
selector: '[noClickable]' | |
}) | |
export class ComponentLockDirective { | |
constructor() { } | |
@HostListener('click', ['$event']) | |
public onClick(event: any): void { | |
event.stopPropagation(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div noClickable> bitch can not click me </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment