This repository was archived by the owner on Dec 4, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +14
-11
lines changed Expand file tree Collapse file tree 4 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -7,17 +7,18 @@ import { Router } from '@angular/router';
7
7
8
8
import { Hero } from './hero' ;
9
9
import { HeroService } from './hero.service' ;
10
-
10
+ // #docregion metadata
11
11
@Component ( {
12
12
moduleId : module . id ,
13
13
selector : 'my-dashboard' ,
14
- // #docregion templateUrl
15
14
templateUrl : 'dashboard.component.html' ,
16
- // #enddocregion templateUrl
15
+ // #enddocregion metadata
17
16
// #docregion css
18
17
styleUrls : [ 'dashboard.component.css' ]
19
18
// #enddocregion css
19
+ // #docregion metadata
20
20
} )
21
+ // #enddocregion metadata
21
22
// #docregion component
22
23
export class DashboardComponent implements OnInit {
23
24
Original file line number Diff line number Diff line change @@ -6,16 +6,16 @@ import { Location } from '@angular/common';
6
6
7
7
import { Hero } from './hero' ;
8
8
import { HeroService } from './hero.service' ;
9
-
9
+ // #docregion metadata
10
10
@Component ( {
11
11
moduleId : module . id ,
12
12
selector : 'my-hero-detail' ,
13
- // #docregion templateUrl
14
13
templateUrl : 'hero-detail.component.html' ,
15
- // #enddocregion templateUrl , v2
14
+ // #enddocregion metadata , v2
16
15
styleUrls : [ 'hero-detail.component.css' ]
17
- // #docregion v2
16
+ // #docregion metadata, v2
18
17
} )
18
+ // #enddocregion metadata
19
19
// #docregion implement
20
20
export class HeroDetailComponent implements OnInit {
21
21
// #enddocregion implement
Original file line number Diff line number Diff line change @@ -8,7 +8,9 @@ import { HeroService } from './hero.service';
8
8
9
9
// #docregion renaming, metadata
10
10
@Component ( {
11
+ // #enddocregion renaming
11
12
moduleId : module . id ,
13
+ // #docregion renaming
12
14
selector : 'my-heroes' ,
13
15
// #enddocregion renaming
14
16
templateUrl : 'heroes.component.html' ,
Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ block redirect-vs-use-as-default
367
367
368
368
Set the `moduleId` property to `module.id` for module-relative loading of the `templateUrl`.
369
369
370
- + makeExcerpt('app/dashboard.component.ts' , 'templateUrl ' )
370
+ + makeExcerpt('app/dashboard.component.ts' , 'metadata ' )
371
371
372
372
:marked
373
373
Create that file with this content:
@@ -585,9 +585,9 @@ block extract-id
585
585
+ makeExample('app/hero-detail.component.html' )
586
586
587
587
:marked
588
- We update the component metadata with a `templateUrl` pointing to the template file that we just created.
588
+ We update the component metadata with a `moduleId` and a ` templateUrl` pointing to the template file that we just created.
589
589
590
- + makeExcerpt('app/hero-detail.component.ts' , 'templateUrl ' )
590
+ + makeExcerpt('app/hero-detail.component.ts' , 'metadata ' )
591
591
592
592
:marked
593
593
Refresh the browser and see the results.
@@ -759,7 +759,7 @@ figure.image-display
759
759
1. *Cut-and-paste* the template contents into a new <span ngio-ex>heroes.component.html</span> file.
760
760
1. *Cut-and-paste* the styles contents into a new <span ngio-ex>heroes.component.css</span> file.
761
761
1. *Set* the component metadata's `templateUrl` and `styleUrls` properties to refer to both files.
762
- 1. *Set* the `moduleId` property to `module.id` so that ' templateUrl` and `styleUrls` are relative to the component.
762
+ 1. *Set* the `moduleId` property to `module.id` so that ` templateUrl` and `styleUrls` are relative to the component.
763
763
764
764
.l-sub-section
765
765
:marked
You can’t perform that action at this time.
0 commit comments