Last change
on this file since 6e6f04b was 8e74e2f, checked in by DimitarSlezenkovski <dslezenkovski@…>, 4 years ago |
Fix bugs, add some more.
|
-
Property mode
set to
100644
|
File size:
673 bytes
|
Rev | Line | |
---|
[8e74e2f] | 1 | import { Component, OnInit } from '@angular/core';
|
---|
| 2 | import { AuthService } from '../shared/services/auth.service';
|
---|
[30a465f] | 3 |
|
---|
| 4 | @Component({
|
---|
| 5 | selector: 'app-nav-menu',
|
---|
| 6 | templateUrl: './nav-menu.component.html',
|
---|
| 7 | styleUrls: ['./nav-menu.component.css']
|
---|
| 8 | })
|
---|
[8e74e2f] | 9 | export class NavMenuComponent implements OnInit {
|
---|
[30a465f] | 10 | isExpanded = false;
|
---|
[8e74e2f] | 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 | }
|
---|
[30a465f] | 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.