*ngSwitch directive is used for handling multiple conditions (just like JavaScript's switch statement).
typescript
<div [ngSwitch]="userRole">
<p *ngSwitchCase="'admin'">👑 Admin Dashboard</p>
<p *ngSwitchCase="'editor'">✏️ Editor Panel</p>
<p *ngSwitchCase="'viewer'">👀 Viewer Mode</p>
<p *ngSwitchDefault>🔒 Access Denied</p>
</div>
// component.ts
export class MyComponent {
userRole = 'editor';
}You should see
(Since userRole is 'editor', '✏️ Editor Panel' will be displayed)