mirror of https://github.com/abpframework/abp.git
7 changed files with 60 additions and 65 deletions
@ -1,10 +1,11 @@ |
|||
import { Component } from '@angular/core'; |
|||
|
|||
@Component({ |
|||
standalone: false, |
|||
selector: 'app-root', |
|||
template: ` |
|||
<abp-loader-bar></abp-loader-bar> |
|||
<abp-dynamic-layout></abp-dynamic-layout> |
|||
<abp-loader-bar /> |
|||
<abp-dynamic-layout /> |
|||
`,
|
|||
}) |
|||
export class AppComponent {} |
|||
|
|||
@ -1,25 +1,21 @@ |
|||
import { RoutesService, eLayoutType } from '@abp/ng.core'; |
|||
import { APP_INITIALIZER } from '@angular/core'; |
|||
import { inject, provideAppInitializer } from '@angular/core'; |
|||
|
|||
export const APP_ROUTE_PROVIDER = [ |
|||
{ |
|||
provide: APP_INITIALIZER, |
|||
useFactory: configureRoutes, |
|||
deps: [RoutesService], |
|||
multi: true, |
|||
}, |
|||
provideAppInitializer(() => { |
|||
configureRoutes(); |
|||
}), |
|||
]; |
|||
|
|||
function configureRoutes(routesService: RoutesService) { |
|||
return () => { |
|||
routesService.add([ |
|||
{ |
|||
path: '/', |
|||
name: 'Home', |
|||
iconClass: 'fas fa-home', |
|||
order: 1, |
|||
layout: eLayoutType.application, |
|||
}, |
|||
]); |
|||
}; |
|||
function configureRoutes() { |
|||
const routesService = inject(RoutesService); |
|||
routesService.add([ |
|||
{ |
|||
path: '/', |
|||
name: 'Home', |
|||
iconClass: 'fas fa-home', |
|||
order: 1, |
|||
layout: eLayoutType.application, |
|||
}, |
|||
]); |
|||
} |
|||
|
|||
@ -1,26 +1,22 @@ |
|||
import { eLayoutType, RoutesService } from '@abp/ng.core'; |
|||
import { APP_INITIALIZER } from '@angular/core'; |
|||
import { inject, provideAppInitializer } from '@angular/core'; |
|||
import { eMyProjectNameRouteNames } from '../enums/route-names'; |
|||
|
|||
export const MY_PROJECT_NAME_ROUTE_PROVIDERS = [ |
|||
{ |
|||
provide: APP_INITIALIZER, |
|||
useFactory: configureRoutes, |
|||
deps: [RoutesService], |
|||
multi: true, |
|||
}, |
|||
provideAppInitializer(() => { |
|||
configureRoutes(); |
|||
}), |
|||
]; |
|||
|
|||
export function configureRoutes(routesService: RoutesService) { |
|||
return () => { |
|||
routesService.add([ |
|||
{ |
|||
path: '/my-project-name', |
|||
name: eMyProjectNameRouteNames.MyProjectName, |
|||
iconClass: 'fas fa-book', |
|||
layout: eLayoutType.application, |
|||
order: 3, |
|||
}, |
|||
]); |
|||
}; |
|||
export function configureRoutes() { |
|||
const routesService = inject(RoutesService); |
|||
routesService.add([ |
|||
{ |
|||
path: '/my-project-name', |
|||
name: eMyProjectNameRouteNames.MyProjectName, |
|||
iconClass: 'fas fa-book', |
|||
layout: eLayoutType.application, |
|||
order: 3, |
|||
}, |
|||
]); |
|||
} |
|||
|
|||
Loading…
Reference in new issue