You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-2
Original file line number
Diff line number
Diff line change
@@ -116,9 +116,18 @@ Module | `ng g module my-module`
116
116
117
117
### Generating a route
118
118
119
-
Generating routes in the CLI has been disabled for the time being. A new router and new route generation blueprints are coming.
119
+
The CLI supports routing in several ways:
120
+
121
+
- We include the `@angular/router` NPM package when creating or initializing a project.
122
+
123
+
- When you generate a module, you can use the `--routing` option like `ng g module my-module --routing` to create a separate file `my-module-routing.module.ts` to store the module routes.
124
+
125
+
The file includes an empty `Routes` object that you can fill with routes to different components and/or modules.
126
+
127
+
The `--routing` option also generates a default component with the same name as the module.
128
+
129
+
- You can use the `--routing` option with `ng new` or `ng init` to create a `app-routing.module.ts` file when you create or initialize a project.
120
130
121
-
You can read the official documentation for the new Router here: https://angular.io/docs/ts/latest/guide/router.html. Please note that even though route generation is disabled, building your projects with routing is still fully supported.
0 commit comments