Created
July 28, 2017 14:51
-
-
Save ingeit/d770b8cc591b5e87754ce2e696a743e6 to your computer and use it in GitHub Desktop.
ViewChild
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 { ViewChild } from '@angular/core'; | |
@ViewChild('idDelElemento') imagen: any; | |
imagenHTML: any; | |
//costructor | |
this.imagenHTML = this.imagen.nativeElement; | |
//ya puedo trabajar, por ejmeplo obteniendo el alto del contenedor | |
this.imagenHTML.height | |
//HTML | |
<img #idDelElemento src=",,/../assets/cupon.png"/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment