DEV Community

Discussion on: How to Programmatically Trigger 'Click' Event in Angular 4 & 5

Collapse
 
vaibhav_arora__ profile image
Vaibhav Arora

Need 1 help to understand guys.

When Angular suggests(I guess so) to use Renderer2 and not directly access your HTML DOM, doesn't that future proof law or whatever we call that, applies to this code.

Is there any other way if we had to do it reactively and not template wise, at least add some custom code in between like "event.preventDefault()"