import { Injectable } from '@angular/core' ; import { FuseSidebarComponent } from './sidebar.component' ; @ Injectable ( { providedIn : 'root' } ) export class FuseSidebarService { private _registry : { [ key ] : FuseSidebarComponent ; } = { } ; /**
     * Constructor
     */ constructor ( ) { } param key param sidebar register ( key , sidebar ) { if ( this . _registry [ key ] ) { console . error ( `The sidebar with the key '${ key }' already exists. Either unregister it first or use a unique key.` ) ; return ; } this . _registry [ key ] = sidebar ; } param key unregister ( key ) { if ( ! this . _registry [ key ] ) { console . warn ( `The sidebar with the key '${ key }' doesn't exist in the registry.` ) ; } delete this . _registry [ key ] ; } param key returns { FuseSidebarComponent } getSidebar ( key ) { if ( ! this . _registry [ key ] ) { console . warn ( `The sidebar with the key '${ key }' doesn't exist in the registry.` ) ; return ; } return this . _registry [ key ] ; } }