import { Component , OnInit } from '@angular/core' ; import { StaffService } from './../model/staff.service' ; @ Component ( { selector : 'app-backend' , templateUrl : './backend-layout.component.html' } ) export class BackendLayoutComponent implements OnInit { public userData : any = { } ; public today : Date ; public menuOpen : boolean = false ; constructor ( public staffService ) { this . today = new Date ( ) ; } ngOnInit ( ) { const jwtValue = this . staffService . getJWTValue ( ) ; if ( jwtValue !== null ) { this . userData = jwtValue . data ; } } toggleMenu ( ) { this . menuOpen = ! this . menuOpen ; } }