import { Component , OnInit , OnChanges } from '@angular/core' ; import { ContextualMenu } from "../../models/contextual-menu.model" ; import { UtilsService } from "../../services/utils.service" ; import { ActivatedRoute , NavigationStart , NavigationEnd , Router } from "@angular/router" ; import { ResponsiveNavigationService } from "../../services/responsive-navigation.service" ; import { AccountService } from "../../services/account.service" ; import { ContextService } from "../../services/context.service" ; import { GroupService } from "../../services/groups/group.service" ; @ Component ( { selector : 'app-home' , templateUrl : './home.component.html' , styleUrls : [ './home.component.scss' ] , } ) export class HomeComponent { public notifications ; public menu : ContextualMenu [ ] ; public midTransition = false ; public user ; constructor ( private router , private context , public responsiveNavigationService , private activatedRoute ) { this . user = this . context . user ; this . menu = [ new ContextualMenu ( 'All Groups' , '/base/home/all-groups-section' ) , new ContextualMenu ( 'My Groups' , '/base/home/my-groups-section' ) , new ContextualMenu ( 'Requests' , '/base/home/requests' ) , new ContextualMenu ( 'Pending Approvals' , '/base/home/pending-approval' ) ] ; this . router . events . subscribe ( ( val ) => { if ( val instanceof NavigationStart ) { this . midTransition = true ; this . responsiveNavigationService . setSidemenu ( false ) ; } else if ( val instanceof NavigationEnd ) { this . midTransition = false ; } } ) ; } closeSidemenu ( ) { this . responsiveNavigationService . setSidemenu ( false ) ; } }