Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $ ng g c contacts-list
1. Create a component `ContactsListComponent` with angular-cli and move the current contact list logic there from `ContactsAppComponent`
2. Import `ContactsListComponent` in `src/app/app.module.ts` and add it to the module's `declarations`.
2. Create `src/app/app.routes.ts`, import the `ContactsListComponent` and export an array with routes (e.g. `export const APP_ROUTES = [...]`), holding one route pointing to `ContactsListComponent`.
3. In `app.module.ts` import `RouterModule` from `@angular/router` and `APP_ROUTES` from `./app/app.routes`
3. In `app.module.ts` import `RouterModule` from `@angular/router` and `APP_ROUTES` from `./app.routes`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we really want to do that then it should be ./src/app/app.routes . The ./app/ indicates that we're putting this file in there. ./app.routes tells me it's the root of the projects (so next to src) which would be wrong..

4. Add `RouterModule.forRoot(APP_ROUTES)` to the `imports` array of the module
5. Add `<router-outlet>` in `ContactsAppComponent`'s view to load and render components

Expand Down