[menu] logout is a special item
This commit is contained in:
parent
91e3943a74
commit
1bdbb1b908
@ -1,14 +1,15 @@
|
|||||||
<div class="sidenav" [class]="navOpen ? 'open': 'close'" *ngIf="userMenuGroups$ | async as menuGroups">
|
<div class="sidenav" [class]="navOpen ? 'open': 'close'" *ngIf="userMenuGroups$ | async as menuGroups">
|
||||||
<div class="pt-3 pl-4 pr-4">
|
<div class="pt-3 pl-4 pr-4">
|
||||||
<nav>
|
<nav>
|
||||||
<div *ngFor="let group of menuGroups">
|
<div *ngFor="let group of menuGroups" >
|
||||||
<h6 class="d-flex justify-content-between align-items-center mt-4 mb-2 text-uppercase">
|
<h6 class="d-flex justify-content-between align-items-center mt-4 mb-2 text-uppercase">
|
||||||
<span>{{ group.title }}</span>
|
<span>{{ group.title }}</span>
|
||||||
</h6>
|
</h6>
|
||||||
<ul class="nav flex-column" *ngFor="let item of group.items">
|
<ul class="nav flex-column" *ngFor="let item of group.items">
|
||||||
<li class="nav-item d-flex justify-content-start align-items-center" (click)="navOpen = false;">
|
<li class="nav-item d-flex justify-content-start align-items-center" (click)="navOpen = false;">
|
||||||
<fa-icon [icon]="['fas', item.faIcon]" [fixedWidth]="true"></fa-icon>
|
<fa-icon [icon]="['fas', item.faIcon]" [fixedWidth]="true"></fa-icon>
|
||||||
<a class="nav-link" routerLinkActive="active" [routerLink]="[item.link]" role="tab">{{ item.title }}</a>
|
<a *ngIf="item.link === 'logout'" class="nav-link" role="tab" (click)="logout()">{{ item.title }}</a>
|
||||||
|
<a *ngIf="item.title !== 'Logout'" class="nav-link" [routerLink]="[item.link]" role="tab">{{ item.title }}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -20,4 +20,8 @@ export class MenuComponent implements OnInit {
|
|||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.userMenuGroups$ = this.apiService.getUserMenuGroups$();
|
this.userMenuGroups$ = this.apiService.getUserMenuGroups$();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logout(): void {
|
||||||
|
console.log('logout');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user