*ngSwitch directive သည် multiple conditions များအတွက် အသုံးပြုသည် (JavaScript ၏ 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
(userRole သည် 'editor' ဖြစ်သောကြောင့် '✏️ Editor Panel' ဟု ပြသမည်)