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

How to Create an Email Sender AI Agent Using n8n (Step-by-Step Guide)

React Native | Activity Indicator Component

useEffect Hook in ReactJs