mirror of https://github.com/abpframework/abp.git
3 changed files with 15 additions and 13 deletions
@ -1,20 +1,20 @@ |
|||||
import { eLayoutType, RoutesService } from '@abp/ng.core'; |
import { eLayoutType, RoutesService } from '@abp/ng.core'; |
||||
import { APP_INITIALIZER } from '@angular/core'; |
import { inject, provideAppInitializer } from '@angular/core'; |
||||
|
|
||||
export const APP_ROUTE_PROVIDER = [ |
export const APP_ROUTE_PROVIDER = [ |
||||
{ provide: APP_INITIALIZER, useFactory: configureRoutes, deps: [RoutesService], multi: true }, |
provideAppInitializer(() => { |
||||
|
configureRoutes(inject(RoutesService)); |
||||
|
}), |
||||
]; |
]; |
||||
|
|
||||
function configureRoutes(routesService: RoutesService) { |
function configureRoutes(routesService: RoutesService) { |
||||
return () => { |
routesService.add([ |
||||
routesService.add([ |
{ |
||||
{ |
path: '/', |
||||
path: '/', |
name: '::Menu:Home', |
||||
name: '::Menu:Home', |
iconClass: 'fas fa-home', |
||||
iconClass: 'fas fa-home', |
order: 1, |
||||
order: 1, |
layout: eLayoutType.application, |
||||
layout: eLayoutType.application, |
}, |
||||
}, |
]); |
||||
]); |
|
||||
}; |
|
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue