Showing and Hiding Elements
- Using ngIf
<div *ngIf="flag">Some text</div>
- Using hidden property binding
<div [hidden]="!flag">Some text</div>
- Using class
<div [class.hidden]="!flag">Some text</div>
- Using style
<div [style.display]="flag ? 'block' : 'none'">Some text</div>