- for example if we create any component from angular-cli (ng g component compName ) it is automatically declaring
https://i.stack.imgur.com/KiXzj.jpg
- same way i want to declare automatically in routing at the time of component creation, like this
https://i.stack.imgur.com/KiXzj.jpg
As of I know, Angular cli generates a component on ng g c comp-name and add the component to the nearest angular module to make the component work.
Putting the component in the routes is at the sole discretion of the developer and hence angular cli will not put it in the routes. It has to be done manually by the developer
We cannot declare the routes automatically, its totally depends on the functionality. We need to add them manually.