Routing Instructions
@frrri/ngxs-crud/routing aims at making it easy to configure your components data layer via the angular router. This way, your components are highly reusable and can display different sets of data for different routes easily.
First add FrrriRoutingModule.forRoot()
to your AppModule:
app.module.ts
With a State setup like shown in Crud Entities, you can configure your routes the following way:
Configuring your routes
entities.posts defined in the example below is the corresponding collection's state path. See States Registry for more information.
posts-routing.module.ts
It's important to wrap the routes provided to RouterModule with our frrriRoutes() function, so our resolver will run for every route.
Have a look at posts-routing.module.ts in the ng-intergation on GitHub for more examples.
Last updated