Dom Manipulate in angular

Faisal Ahmed - Jul 8 - - Dev Community
<h2 #hello1>Hello world</h2>
<button (click)="handleFunction()">Change Text</button>
Enter fullscreen mode Exit fullscreen mode
  @ViewChild('hello1', { static: true }) helloElement: ElementRef;

  handleFunction() {
    this.helloElement.nativeElement.textContent = 'Hello Angular!';
    this.helloElement.nativeElement.style.color = 'red';
    this.helloElement.nativeElement.style.backgroundColor = 'yellow';
    this.helloElement.nativeElement.style.fontSize = '30px';
  }
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player