LacunaSpa is a framework that includes common parts of Lacuna's recent products, and, thus, was born as a code reuse strategy.
- This package in intended to work with Angular 7.X.X
This Angular package includes common services, pipes, guards, components and API.
Besides using the resources mentioned above, you can also use its "LacunaSpaRouteTree" function inside your routing module's forRoot(), so that it returns the pre-configured Lacuna common route tree. Inside this function, you can configure the specific routes of your application.
While configuring a specific route level, you can also use the function "ManagementRoutes", which returns an array of routes for management of subscriptions, users, applications, and so on.
import { genLacunaSpaRouteTree, LacunaSpaModule } from 'lacuna-spa';
//...
@NgModule({
declarations: [
//...
],
imports: [
//...,
LacunaSpaModule.forRoot({
listOfRoles: ['Admin', 'Manager', 'Worker'],
requiredIdClaims: ['cpf'],
//...
}),
RouterModule.forRoot(LacunaSpaRouteTree(
{
homeComponent: WelcomeComponent,
layoutComponent: LayoutComponent,
},
{
privateRoutes: [
//...,
],
subscriptionRoutes: [
//...,
...ManagementRoutes({ subscriptionDetailComponent: SubscriptionDetailComponent }),
],
}
))
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
//...