-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathinformation.component.ts
More file actions
19 lines (18 loc) · 812 Bytes
/
information.component.ts
File metadata and controls
19 lines (18 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { HasRoleDirective, IsSuperAdminDirective } from './has-role.directive';
@Component({
selector: 'app-information',
template: `
<h2 class="mt-10 text-xl">Information Panel</h2>
<!-- admin can see everything -->
<div *isSuperAdmin>visible only for super admin</div>
<div *hasRole="'MANAGER'">visible if manager</div>
<div *hasRole="['MANAGER', 'READER']">visible if manager and/or reader</div>
<div *hasRole="['MANAGER', 'WRITER']">visible if manager and/or writer</div>
<div *hasRole="'CLIENT'">visible if client</div>
<div>visible for everyone</div>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [HasRoleDirective, IsSuperAdminDirective],
})
export class InformationComponent {}