import { Component , ChangeDetectionStrategy } from '@angular/core' ; import { Router } from '@angular/router' ; import { AuthorizationService , PermissionConfig } from 'rebirth-permission' ; @ Component ( { selector : 'manage-navbar' , styleUrls : [ './manage-navbar.scss' ] , templateUrl : './manage-navbar.html' , changeDetection : ChangeDetectionStrategy . OnPush } ) export class ManageNavbarComponent { showNavBar : boolean ; constructor ( private authorizationService , private router , private permissionConfig ) { } toggleNavBarState ( $event ) { $event . stopPropagation ( ) ; this . showNavBar = ! this . showNavBar ; } hideNavBar ( $event ? ) { $event && $event . stopPropagation ( ) ; this . showNavBar = false ; } logout ( ) { this . authorizationService . logout ( ) ; this . router . navigateByUrl ( this . permissionConfig . loginPage ) ; } }