'Get Angular Child routes from API

I want to get child routes from a database table. Can anyone please tell me how to call an api endpoint and bind the response to build child routes for a particular module.

I don't want to build the entire routes for the application but only for a particular parent route.

RouterModule.forChild(childRoutes)

So here I want to get childRoutes from API instead of hardcoding in the application.

Thanks, Sathish



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source