karthik kumar
karthik kumar

Reputation: 3

Auto declare components, path in routing module at the time of create a new components Angular 7

  1. for example if we create any component from angular-cli (ng g component compName ) it is automatically declaring

https://i.sstatic.net/KiXzj.jpg

  1. same way i want to declare automatically in routing at the time of component creation, like this

https://i.sstatic.net/RthNi.jpg

Upvotes: 0

Views: 262

Answers (2)

Ankur Jain
Ankur Jain

Reputation: 221

We cannot declare the routes automatically, its totally depends on the functionality. We need to add them manually.

Upvotes: 0

dileepkumar jami
dileepkumar jami

Reputation: 2265

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

Upvotes: 1

Related Questions