I need to know the difference between Angular app-routing.module.ts and app.routes.ts and any best practices. I am using Angular latest. 17.0.10.
Routing module requires a list of routes in its' configuration. We could just inline this potentially very long list of routes in same file, or we could move list of routes to const routes in separate file, to not have a long list in the middle of file with routing and other logic. Moving routes to separate file makes reading file with routing logic easier
Both serves for similar purpose, configuring routes.In angular 17+ version the usage of app.route.ts is introduced. In previous versions of angular app.routing.module.ts is used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With