I am referencing a control using ElementRef and for this I use the following:
@ViewChild('btnGuardarDatosGenerales') btnGuardarDatosGenerales: ElementRef;
I need the reference to be able to reach your click () event, with javascript I can achieve doing it:
let buttonDG: any = document.getElementsByName('btnGuardarDG')[0];
buttonDG.click();
but when doing it with ElementRef I do not get it:
this.btnGuardarDatosGenerales.nativeElement.click();
... I could do it with javascript but it's not the idea. Any suggestions, in which I can be wrong?
Thank you.