Toggle Button in Angular 13

app.component.html: 

  <button (click)="toggle()">Toggle</button>
  <h1 *ngIf="display">Toggle Button Content</h1>


app.component.ts:


display=true;
toggle()
{
this.display=!this.display;
}




Comments

Popular posts from this blog

Uncontrolled Component - React Js

OG And Twitter Card Code For Products