This module provides strong-typed routing for Angular and auto-generates a strong-typed navigation service.
The purpose of these tools is to create a tight-relation between:
⚠️ The
navigation-x
module is in PREVIEW mode. Implementation might change. Avoid using in production.Please provide feedback on the module.
Call routeConfigFor<YOUR_ENTITY>()
to create a strongly-typed route configurator for a specific entity (or data structure) related with a route tree:
Use the returned configurator to wrap your Angular route and store the strongly-typed route in a const:
Important
Pass your route configas const
Bonus
To improve the auto-generated names for your navigation methods, use thefriendlyName
property in your route's config.
Replace your provideRouter()
call with provideRouterX()
and pass in the returned route config:
If you used
provideRoutes()
for that specific route tree, callprovideRoutesX()
.
Call useNavigationX()
in your component/service and enjoy the auto-generated navigation service: