import { Component , EventEmitter , Output , ViewEncapsulation } from '@angular/core' ; import { Router } from '@angular/router' ; import { LeftMenuService } from "./left-menu.service" ; @ Component ( { selector : 'app-left-menu' , templateUrl : './left-menu.component.html' , styleUrls : [ './left-menu.component.css' ] , providers : [ LeftMenuService ] } ) export class LeftMenuComponent { isCollapsed : boolean [ ] = [ false , false , false , false , false , false , false , false , false ] ; @ Output ( ) onRouteClicked = new EventEmitter < String > ( ) ; menuContent = [ ] ; constructor ( private router , private menuService ) { this . menuContent = menuService . getMenuContent ( ) ; } public collapsed ( event ) { } public expanded ( event ) { } routeTo ( routerLink , index ) { this . onRouteClicked . emit ( routerLink ) ; this . router . navigate ( [ routerLink ] ) ; } }