From e503efe8c862570e1000e08ed8d005a6af1f3eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Fri, 14 Oct 2016 01:41:57 +0200 Subject: [PATCH] docs(toh5): add moduleId information (#2597) --- public/docs/_examples/toh-5/ts/app/dashboard.component.ts | 7 ++++--- .../docs/_examples/toh-5/ts/app/hero-detail.component.ts | 8 ++++---- public/docs/_examples/toh-5/ts/app/heroes.component.ts | 2 ++ public/docs/ts/latest/tutorial/toh-pt5.jade | 8 ++++---- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/public/docs/_examples/toh-5/ts/app/dashboard.component.ts b/public/docs/_examples/toh-5/ts/app/dashboard.component.ts index 61a56463c5..f72a149c8c 100644 --- a/public/docs/_examples/toh-5/ts/app/dashboard.component.ts +++ b/public/docs/_examples/toh-5/ts/app/dashboard.component.ts @@ -7,17 +7,18 @@ import { Router } from '@angular/router'; import { Hero } from './hero'; import { HeroService } from './hero.service'; - + // #docregion metadata @Component({ moduleId: module.id, selector: 'my-dashboard', - // #docregion templateUrl templateUrl: 'dashboard.component.html', - // #enddocregion templateUrl + // #enddocregion metadata // #docregion css styleUrls: [ 'dashboard.component.css' ] // #enddocregion css + // #docregion metadata }) +// #enddocregion metadata // #docregion component export class DashboardComponent implements OnInit { diff --git a/public/docs/_examples/toh-5/ts/app/hero-detail.component.ts b/public/docs/_examples/toh-5/ts/app/hero-detail.component.ts index 38b7384618..3ca01d2361 100644 --- a/public/docs/_examples/toh-5/ts/app/hero-detail.component.ts +++ b/public/docs/_examples/toh-5/ts/app/hero-detail.component.ts @@ -6,16 +6,16 @@ import { Location } from '@angular/common'; import { Hero } from './hero'; import { HeroService } from './hero.service'; - +// #docregion metadata @Component({ moduleId: module.id, selector: 'my-hero-detail', - // #docregion templateUrl templateUrl: 'hero-detail.component.html', - // #enddocregion templateUrl, v2 + // #enddocregion metadata, v2 styleUrls: [ 'hero-detail.component.css' ] - // #docregion v2 + // #docregion metadata, v2 }) +// #enddocregion metadata // #docregion implement export class HeroDetailComponent implements OnInit { // #enddocregion implement diff --git a/public/docs/_examples/toh-5/ts/app/heroes.component.ts b/public/docs/_examples/toh-5/ts/app/heroes.component.ts index 5fa50a3411..cbcb598ac2 100644 --- a/public/docs/_examples/toh-5/ts/app/heroes.component.ts +++ b/public/docs/_examples/toh-5/ts/app/heroes.component.ts @@ -8,7 +8,9 @@ import { HeroService } from './hero.service'; // #docregion renaming, metadata @Component({ + // #enddocregion renaming moduleId: module.id, + // #docregion renaming selector: 'my-heroes', // #enddocregion renaming templateUrl: 'heroes.component.html', diff --git a/public/docs/ts/latest/tutorial/toh-pt5.jade b/public/docs/ts/latest/tutorial/toh-pt5.jade index d1a54c2171..531c23cf57 100644 --- a/public/docs/ts/latest/tutorial/toh-pt5.jade +++ b/public/docs/ts/latest/tutorial/toh-pt5.jade @@ -367,7 +367,7 @@ block redirect-vs-use-as-default Set the `moduleId` property to `module.id` for module-relative loading of the `templateUrl`. -+makeExcerpt('app/dashboard.component.ts', 'templateUrl') ++makeExcerpt('app/dashboard.component.ts', 'metadata') :marked Create that file with this content: @@ -585,9 +585,9 @@ block extract-id +makeExample('app/hero-detail.component.html') :marked - We update the component metadata with a `templateUrl` pointing to the template file that we just created. + We update the component metadata with a `moduleId` and a `templateUrl` pointing to the template file that we just created. -+makeExcerpt('app/hero-detail.component.ts', 'templateUrl') ++makeExcerpt('app/hero-detail.component.ts', 'metadata') :marked Refresh the browser and see the results. @@ -759,7 +759,7 @@ figure.image-display 1. *Cut-and-paste* the template contents into a new heroes.component.html file. 1. *Cut-and-paste* the styles contents into a new heroes.component.css file. 1. *Set* the component metadata's `templateUrl` and `styleUrls` properties to refer to both files. - 1. *Set* the `moduleId` property to `module.id` so that 'templateUrl` and `styleUrls` are relative to the component. + 1. *Set* the `moduleId` property to `module.id` so that `templateUrl` and `styleUrls` are relative to the component. .l-sub-section :marked