import { Component , OnInit } from '@angular/core' ; import { NavigationService , Page , } from '../../services/navigation/navigation.service' ; import { NavRoute } from '../../../nav-routing' ; import { AuthService } from '../../../auth/auth.service' ; import { ActivatedRoute , Router } from '@angular/router' ; @ Component ( { selector : 'app-nav' , templateUrl : './nav.component.html' , styleUrls : [ './nav.component.scss' ] , } ) export class NavComponent implements OnInit { isOpen = true ; constructor ( private navigationService , private authService , private router ) { } ngOnInit ( ) { } public toggleSideNav ( ) { this . isOpen = ! this . isOpen ; } public getNavigationItems ( ) { return this . navigationService . getNavigationItems ( ) ; } public getActivePage ( ) { return this . navigationService . getActivePage ( ) ; } public logout ( ) { this . authService . logout ( ) ; this . router . navigate ( [ 'login' ] , { replaceUrl : true } ) ; } public getPreviousUrl ( ) { return this . navigationService . getPreviousUrl ( ) ; } }