Last change
on this file since db484c9 was 8e74e2f, checked in by DimitarSlezenkovski <dslezenkovski@…>, 4 years ago |
Fix bugs, add some more.
|
-
Property mode
set to
100644
|
File size:
673 bytes
|
Line | |
---|
1 | import { Component, OnInit } from '@angular/core';
|
---|
2 | import { AuthService } from '../shared/services/auth.service';
|
---|
3 |
|
---|
4 | @Component({
|
---|
5 | selector: 'app-nav-menu',
|
---|
6 | templateUrl: './nav-menu.component.html',
|
---|
7 | styleUrls: ['./nav-menu.component.css']
|
---|
8 | })
|
---|
9 | export class NavMenuComponent implements OnInit {
|
---|
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 | }
|
---|
26 |
|
---|
27 | collapse() {
|
---|
28 | this.isExpanded = false;
|
---|
29 | }
|
---|
30 |
|
---|
31 | toggle() {
|
---|
32 | this.isExpanded = !this.isExpanded;
|
---|
33 | }
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.