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

Commit a4bc455

Browse files
committed
docs(toh): remove unneeded directive from heroes.component
1 parent e91659a commit a4bc455

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

public/docs/_examples/toh-5/ts/app/heroes.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Component, OnInit } from '@angular/core';
44
import { Router } from '@angular/router-deprecated';
55

66
import { Hero } from './hero';
7-
import { HeroDetailComponent } from './hero-detail.component';
87
import { HeroService } from './hero.service';
98

109
// #docregion metadata
@@ -13,8 +12,7 @@ import { HeroService } from './hero.service';
1312
selector: 'my-heroes',
1413
// #enddocregion heroes-component-renaming
1514
templateUrl: 'app/heroes.component.html',
16-
styleUrls: ['app/heroes.component.css'],
17-
directives: [HeroDetailComponent]
15+
styleUrls: ['app/heroes.component.css']
1816
// #docregion heroes-component-renaming
1917
})
2018
// #enddocregion heroes-component-renaming

public/docs/_examples/toh-6/ts/app/heroes.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ import { Component, OnInit } from '@angular/core';
33
import { Router } from '@angular/router-deprecated';
44

55
import { Hero } from './hero';
6-
import { HeroDetailComponent } from './hero-detail.component';
76
import { HeroService } from './hero.service';
87

98
@Component({
109
selector: 'my-heroes',
1110
templateUrl: 'app/heroes.component.html',
12-
styleUrls: ['app/heroes.component.css'],
13-
directives: [HeroDetailComponent]
11+
styleUrls: ['app/heroes.component.css']
1412
})
1513
export class HeroesComponent implements OnInit {
1614
heroes: Hero[];

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,11 @@ figure.image-display
544544
1. *Cut-and-paste* the styles contents into a new `heroes.component.css` file.
545545
1. *Set* the component metadata's `templateUrl` and `styleUrls` properties to refer to both files.
546546

547-
The revised component data looks like this:
547+
We no longer display the `HeroDetailComponent` in the `HeroesComponent` template because we're navigating to it.
548+
So we can remove it from the metadata `directives` array. The `directives` array is now empty so we delete it.
549+
We might as well delete the `HeroDetailComponent` import statement too.
550+
551+
The revised component metadata looks like this:
548552
+makeExample('toh-5/ts/app/heroes.component.ts', 'metadata', 'app/heroes.component.ts (revised metadata)')(format=".")
549553
:marked
550554
Now we can see what's going on as we update the component class along the same lines as the dashboard:

0 commit comments

Comments
 (0)