Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 8bd7e38

Browse files
fix(toh-5): Fixed issues in tutorial flow
The HeroDetailComponent should be in the module declarations from the beginning.
1 parent 7dc18f8 commit 8bd7e38

File tree

4 files changed

+11
-18
lines changed

4 files changed

+11
-18
lines changed

public/docs/_examples/toh-5/ts/app/app.module.1.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { BrowserModule } from '@angular/platform-browser';
44
import { FormsModule } from '@angular/forms';
55

66
import { AppComponent } from './app.component';
7-
7+
import { HeroDetailComponent } from './hero-detail.component';
88
import { HeroesComponent } from './heroes.component';
99

1010
import { HeroService } from './hero.service';
@@ -16,6 +16,7 @@ import { HeroService } from './hero.service';
1616
],
1717
declarations: [
1818
AppComponent,
19+
HeroDetailComponent,
1920
HeroesComponent
2021
],
2122
providers: [

public/docs/_examples/toh-5/ts/app/app.module.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ import { AppComponent } from './app.component';
88
// #docregion routing
99
import { routing } from './app.routing';
1010
// #enddocregion routing
11-
11+
import { HeroDetailComponent } from './hero-detail.component';
1212
import { HeroesComponent } from './heroes.component';
1313
import { DashboardComponent } from './dashboard.component';
14-
import { HeroDetailComponent } from './hero-detail.component';
1514

1615
import { HeroService } from './hero.service';
1716
// #docregion routing
@@ -26,11 +25,9 @@ import { HeroService } from './hero.service';
2625
// #docregion dashboard, hero-detail
2726
declarations: [
2827
AppComponent,
28+
HeroDetailComponent,
2929
HeroesComponent,
30-
DashboardComponent,
31-
// #enddocregion dashboard
32-
HeroDetailComponent
33-
// #docregion dashboard
30+
DashboardComponent
3431
],
3532
// #enddocregion dashboard, hero-detail
3633
providers: [

public/docs/_examples/toh-6/ts/app/app.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ import { InMemoryDataService } from './in-memory-data.service';
1616
import { AppComponent } from './app.component';
1717
import { routing } from './app.routing';
1818

19+
import { HeroDetailComponent } from './hero-detail.component';
1920
import { HeroesComponent } from './heroes.component';
2021
import { DashboardComponent } from './dashboard.component';
21-
import { HeroDetailComponent } from './hero-detail.component';
2222
import { HeroService } from './hero.service';
2323
// #enddocregion v1, v2
2424
// #docregion search
@@ -36,9 +36,9 @@ import { HeroSearchComponent } from './hero-search.component';
3636
// #docregion search
3737
declarations: [
3838
AppComponent,
39+
HeroDetailComponent,
3940
HeroesComponent,
4041
DashboardComponent,
41-
HeroDetailComponent,
4242
// #enddocregion v1, v2
4343
HeroSearchComponent
4444
// #docregion v1, v2

public/docs/ts/latest/tutorial/toh-pt5.jade

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -479,15 +479,10 @@ code-example(format='').
479479
The colon (:) in the path indicates that `:id` is a placeholder to be filled with a specific hero `id`
480480
when navigating to the `HeroDetailComponent`.
481481

482-
.l-sub-section
483-
:marked
484-
Remember to import the hero detail component before creating this route.
485-
486-
+ifDocsFor('ts|js')
487-
:marked
488-
Add the `HeroDetailComponent` to our root NgModule's `declarations`.
489-
490-
+makeExcerpt('app/app.module.ts', 'hero-detail')
482+
+ifDocsFor('dart')
483+
.l-sub-section
484+
:marked
485+
Remember to import the hero detail component before creating this route.
491486

492487
:marked
493488
We're finished with the application routes.

0 commit comments

Comments
 (0)