53 lines
1.4 KiB
TypeScript
53 lines
1.4 KiB
TypeScript
import { RoutesService, eLayoutType } from '@abp/ng.core';
|
|
import { APP_INITIALIZER } from '@angular/core';
|
|
|
|
export const APP_ROUTE_PROVIDER = [
|
|
{ provide: APP_INITIALIZER, useFactory: configureRoutes, deps: [RoutesService], multi: true },
|
|
];
|
|
|
|
function configureRoutes(routesService: RoutesService) {
|
|
return () => {
|
|
routesService.add([
|
|
{
|
|
path: '/',
|
|
name: '::Menu:Home',
|
|
iconClass: 'fas fa-home',
|
|
order: 1,
|
|
layout: eLayoutType.application,
|
|
},
|
|
{
|
|
path: '/authors',
|
|
name: '::Menu:Authors',
|
|
iconClass: 'fas fa-user-plus',
|
|
order:2,
|
|
layout: eLayoutType.application,
|
|
requiredPolicy: 'BookStore.Authors',
|
|
},
|
|
{
|
|
path: '/books',
|
|
name: '::Menu:Books',
|
|
iconClass: 'fas fa-book',
|
|
order: 3,
|
|
layout: eLayoutType.application,
|
|
requiredPolicy: 'BookStore.Books',
|
|
},
|
|
{
|
|
path: '/customer',
|
|
name: '::Menu:Customer',
|
|
iconClass: 'fas fa-user',
|
|
order: 4,
|
|
layout: eLayoutType.application,
|
|
requiredPolicy: 'BookStore.Customers',
|
|
},
|
|
{
|
|
path: '/book-issue',
|
|
name: '::Menu:BookIssue',
|
|
iconClass: 'fas fa-book',
|
|
order: 5,
|
|
layout: eLayoutType.application,
|
|
requiredPolicy: 'BookStore.BookIssued',
|
|
},
|
|
]);
|
|
};
|
|
}
|