Answers for "angular elementref"

1

angular elementref

// in template
//<div #myEl></div>

@ViewChild("myEl") el: ElementRef;

ngAfterViewInit(){
  this.el.nativeElement.innerHTML = "Hi";
  console.log(this.el);
}
Posted by: Guest on November-05-2020

Code answers related to "angular elementref"

Code answers related to "Javascript"

Browse Popular Code Answers by Language