How To Add Routes Dynamically In Angular

Da Feng
3 min readSep 25, 2022

Get more control of routes, make application more flexible.

Photo by Javier Allegue Barros on Unsplash

Usually in our code, routes are all pre-defined. We define them as an constant routes variable, and register it into our app-routing.module.ts file. If we have lazy loaded modules, they also have their own routes defined and registered. Each module is very clear about how it will do the navigation, and we don’t normally need to worry…

--

--

Da Feng

I am a software developer, write blogs about Typescript, Angular, React, vue, Front-end technologies, also share some of my life stories and good memories here.