Changeset 8e74e2f for Farmatiko/ClientApp/src/app/nav-menu
- Timestamp:
- 11/16/20 03:55:10 (4 years ago)
- Branches:
- master
- Children:
- db484c9
- Parents:
- 8b13eb2
- Location:
- Farmatiko/ClientApp/src/app/nav-menu
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/ClientApp/src/app/nav-menu/nav-menu.component.html
r8b13eb2 r8e74e2f 26 26 <a class="nav-link text-dark" [routerLink]="['/koronavirus']">Коронавирус</a> 27 27 </li> 28 <li *ngIf="loggedIn"> 29 <button mat-button [matMenuTriggerFor]="menu"><mat-icon>more_vert</mat-icon></button> 30 <mat-menu #menu="matMenu"> 31 <button mat-menu-item [routerLink]="['/dashboard']"><mat-icon>dashboard</mat-icon>Контролна табла</button> 32 <button mat-menu-item (click)="logout()"><mat-icon>exit_to_app</mat-icon>Одјави се</button> 33 </mat-menu> 34 </li> 28 35 </ul> 29 36 </div> -
Farmatiko/ClientApp/src/app/nav-menu/nav-menu.component.ts
r8b13eb2 r8e74e2f 1 import { Component } from '@angular/core'; 1 import { Component, OnInit } from '@angular/core'; 2 import { AuthService } from '../shared/services/auth.service'; 2 3 3 4 @Component({ … … 6 7 styleUrls: ['./nav-menu.component.css'] 7 8 }) 8 export class NavMenuComponent {9 export class NavMenuComponent implements OnInit { 9 10 isExpanded = false; 11 loggedIn: boolean = false; 12 13 constructor(private authService: AuthService) { 14 15 } 16 17 ngOnInit(): void { 18 if(localStorage.getItem('access_token')) { 19 this.loggedIn = true; 20 } 21 } 22 23 logout() { 24 this.authService.logout(); 25 } 10 26 11 27 collapse() {
Note:
See TracChangeset
for help on using the changeset viewer.