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