preventDefault, stopPropagation with Angular2,4,6

Calling these in the (click) function is too late (in most of the cases). Since all if it based on the event emitter framework in Angular.

So how do we call i

Idea taken from here:
https://stackoverflow.com/a/20301030
- This is for the old angular
- but the idea works for new angular too.

this is still a hack.
I feel angular should introduce a directive where $event native javascript functions can be called..

(click)="toggleVariableState($event); $event.stopPropagation()"


I will try to make one.
Similar to click debounce.

Comments

Popular Posts