import { APP_INITIALIZER , FactoryProvider } from '@angular/core' ; import { ISidebarActionConfig , ISidebarConfig , NavigationBuilderService } from './navigation-builder.service' ; export function addSidebarActionItem ( config ) { return { provide : APP_INITIALIZER , multi : true , useFactory : ( navigationBuilderService ) => ( ) => { navigationBuilderService . addSidebarActionItem ( config ) ; } , deps : [ NavigationBuilderService ] } ; } export function registerSidebarWidget ( id , config ) { return { provide : APP_INITIALIZER , multi : true , useFactory : ( navigationBuilderService ) => ( ) => { navigationBuilderService . registerSidebar ( id , config ) ; } , deps : [ NavigationBuilderService ] } ; }