como acessar um elementRef de um componente

The solution for “como acessar um elementRef de um componente” can be found here. The following code will assist you in solving the problem.

@ViewChild(‘FileDialog’) FileDialog: ElementRef;

open_dialog() {
const e: HTMLElement = this.FileDialog.nativeElement;
e.click();
}

//no html criei a variavel FileDialog tbm

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in