import { Component , OnInit } from '@angular/core' ; @ Component ( { selector : 'app-sidebar' , templateUrl : './sidebar.component.html' , } ) export class SidebarComponent implements OnInit { public isOpen = { one : true , two : false , three : false , four : false , five : false , } ; private store : object ; constructor ( ) { } public openChange ( value ) { Object . keys ( this . isOpen ) . forEach ( ( v , i ) => { if ( value == v ) { this . isOpen [ v ] = true ; } else { this . isOpen [ v ] = false ; } } ) ; } public ngOnInit ( ) { } }