stories routing - rbinsztock/angular-cli GitHub Wiki
Documentation below is for CLI version 6. For version 7 see here.
Generating a route
The CLI supports routing in several ways:
-
We include the
@angular/routerNPM package when creating or initializing a project. -
When you generate a module, you can use the
--routingoption likeng g module my-module --routingto create a separate filemy-module-routing.module.tsto store the module routes.The file includes an empty
Routesobject that you can fill with routes to different components and/or modules. -
You can use the
--routingoption withng newto create aapp-routing.module.tsfile when you create or initialize a project.