Merge pull request #3071 from IdeaBlade/relative-paths

chore: convert relative templateUrl/styleUrls to have ./
docs(style-guide): prefix with ./ and other improvements
This commit is contained in:
Ward Bell 2017-01-04 15:58:36 -08:00 committed by GitHub
commit 0d5877db1c
115 changed files with 309 additions and 285 deletions

View File

@ -23,7 +23,7 @@ import { Heroes } from './hero.service';
</ul> </ul>
`, `,
// #enddocregion template // #enddocregion template
styleUrls: ['hero-list.component.css'], styleUrls: ['./hero-list.component.css'],
/* When the element leaves (transition "in => void" occurs), /* When the element leaves (transition "in => void" occurs),
* get the element's current computed height and animate * get the element's current computed height and animate

View File

@ -34,7 +34,7 @@ import { Heroes } from './hero.service';
</ul> </ul>
`, `,
// #enddocregion template // #enddocregion template
styleUrls: ['hero-list.component.css'], styleUrls: ['./hero-list.component.css'],
// #enddocregion // #enddocregion
/** /**
* Define two states, "inactive" and "active", and the end * Define two states, "inactive" and "active", and the end

View File

@ -27,7 +27,7 @@ import { Heroes } from './hero.service';
</ul> </ul>
`, `,
// #enddocregion template // #enddocregion template
styleUrls: ['hero-list.component.css'], styleUrls: ['./hero-list.component.css'],
/* /*
* Define two states, "inactive" and "active", and the end * Define two states, "inactive" and "active", and the end
* styles that apply whenever the element is in those states. * styles that apply whenever the element is in those states.

View File

@ -24,7 +24,7 @@ import { Heroes } from './hero.service';
</ul> </ul>
`, `,
// #enddocregion template // #enddocregion template
styleUrls: ['hero-list.component.css'], styleUrls: ['./hero-list.component.css'],
/* The elements here have two possible states based /* The elements here have two possible states based
* on the hero state, "active", or "inactive". We animate * on the hero state, "active", or "inactive". We animate
* six transitions: Between the two states in both directions, * six transitions: Between the two states in both directions,

View File

@ -23,7 +23,7 @@ import { Heroes } from './hero.service';
</ul> </ul>
`, `,
// #enddocregion template // #enddocregion template
styleUrls: ['hero-list.component.css'], styleUrls: ['./hero-list.component.css'],
/* The element here always has the state "in" when it /* The element here always has the state "in" when it
* is present. We animate two transitions: From void * is present. We animate two transitions: From void
* to in and from in to void, to achieve an animated * to in and from in to void, to achieve an animated

View File

@ -22,7 +22,7 @@ import { Heroes } from './hero.service';
</li> </li>
</ul> </ul>
`, `,
styleUrls: ['hero-list.component.css'], styleUrls: ['./hero-list.component.css'],
styles: [` styles: [`
li { li {
padding: 0 !important; padding: 0 !important;

View File

@ -26,7 +26,7 @@ import { Heroes } from './hero.service';
</ul> </ul>
`, `,
// #enddocregion template // #enddocregion template
styleUrls: ['hero-list.component.css'], styleUrls: ['./hero-list.component.css'],
/** /**
* Define two states, "inactive" and "active", and the end * Define two states, "inactive" and "active", and the end
* styles that apply whenever the element is in those states. * styles that apply whenever the element is in those states.

View File

@ -27,7 +27,7 @@ import { Heroes } from './hero.service';
</ul> </ul>
`, `,
// #enddocregion template // #enddocregion template
styleUrls: ['hero-list.component.css'], styleUrls: ['./hero-list.component.css'],
/* The element here always has the state "in" when it /* The element here always has the state "in" when it
* is present. We animate two transitions: From void * is present. We animate two transitions: From void
* to in and from in to void, to achieve an animated * to in and from in to void, to achieve an animated

View File

@ -22,7 +22,7 @@ import { Heroes } from './hero.service';
</li> </li>
</ul> </ul>
`, `,
styleUrls: ['hero-list.component.css'], styleUrls: ['./hero-list.component.css'],
/* The element here always has the state "in" when it /* The element here always has the state "in" when it
* is present. We animate two transitions: From void * is present. We animate two transitions: From void
* to in and from in to void, to achieve an animated * to in and from in to void, to achieve an animated

View File

@ -27,7 +27,7 @@ import { Heroes } from './hero.service';
</ul> </ul>
`, `,
// #enddocregion template // #enddocregion template
styleUrls: ['hero-list.component.css'], styleUrls: ['./hero-list.component.css'],
/* /*
* Define two states, "inactive" and "active", and the end * Define two states, "inactive" and "active", and the end
* styles that apply whenever the element is in those states. * styles that apply whenever the element is in those states.

View File

@ -5,7 +5,7 @@ import { Hero } from './hero';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'hero-detail', selector: 'hero-detail',
templateUrl: 'hero-detail.component.html' templateUrl: './hero-detail.component.html'
}) })
export class HeroDetailComponent { export class HeroDetailComponent {
@Input() hero: Hero; @Input() hero: Hero;

View File

@ -7,7 +7,7 @@ import { HeroService } from './hero.service';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'hero-list', selector: 'hero-list',
templateUrl: 'hero-list.component.html', templateUrl: './hero-list.component.html',
providers: [ HeroService ] providers: [ HeroService ]
}) })
// #enddocregion providers // #enddocregion providers

View File

@ -3,7 +3,7 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'my-app', selector: 'my-app',
templateUrl: 'app.component.1.html' templateUrl: './app.component.1.html'
}) })
// #docregion class // #docregion class
export class AppComponent { export class AppComponent {

View File

@ -4,7 +4,7 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'my-app', selector: 'my-app',
templateUrl: 'app.component.html' templateUrl: './app.component.html'
}) })
// #docregion class // #docregion class
export class AppComponent { export class AppComponent {

View File

@ -6,8 +6,8 @@ import { IMovie } from './movie';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'my-app', selector: 'my-app',
templateUrl: 'app.component.html', templateUrl: './app.component.html',
styleUrls: [ 'app.component.css' ], styleUrls: [ './app.component.css' ],
providers: [ MovieService ] providers: [ MovieService ]
}) })
export class AppComponent { export class AppComponent {

View File

@ -10,10 +10,10 @@ import { MovieService } from './movie.service';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'movie-list', selector: 'movie-list',
templateUrl: 'movie-list.component.html', templateUrl: './movie-list.component.html',
// #enddocregion component // #enddocregion component
// #docregion style-url // #docregion style-url
styleUrls: [ 'movie-list.component.css' ], styleUrls: [ './movie-list.component.css' ],
// #enddocregion style-url // #enddocregion style-url
}) })
// #enddocregion component // #enddocregion component

View File

@ -4,7 +4,7 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'my-app', selector: 'my-app',
templateUrl: 'app.component.html' templateUrl: './app.component.html'
}) })
export class AppComponent { export class AppComponent {
showHeading = true; showHeading = true;

View File

@ -3,6 +3,6 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'my-app', selector: 'my-app',
templateUrl: 'app.component.html' templateUrl: './app.component.html'
}) })
export class AppComponent { } export class AppComponent { }

View File

@ -24,8 +24,8 @@ export class SomeAbsoluteComponent {
moduleId: module.id, moduleId: module.id,
// #enddocregion module-id // #enddocregion module-id
selector: 'relative-path', selector: 'relative-path',
templateUrl: 'some.component.html', templateUrl: './some.component.html',
styleUrls: ['some.component.css'] styleUrls: ['./some.component.css']
}) })
// #enddocregion relative-config // #enddocregion relative-config

View File

@ -9,7 +9,7 @@ import { UserService } from './user.service';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'my-app', selector: 'my-app',
templateUrl: 'app.component.html', templateUrl: './app.component.html',
// #docregion providers // #docregion providers
providers: [ LoggerService, UserContextService, UserService ] providers: [ LoggerService, UserContextService, UserService ]
// #enddocregion providers // #enddocregion providers

View File

@ -7,7 +7,7 @@ import { QuestionBase } from './question-base';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'df-question', selector: 'df-question',
templateUrl: 'dynamic-form-question.component.html' templateUrl: './dynamic-form-question.component.html'
}) })
export class DynamicFormQuestionComponent { export class DynamicFormQuestionComponent {
@Input() question: QuestionBase<any>; @Input() question: QuestionBase<any>;

View File

@ -8,7 +8,7 @@ import { QuestionControlService } from './question-control.service';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'dynamic-form', selector: 'dynamic-form',
templateUrl: 'dynamic-form.component.html', templateUrl: './dynamic-form.component.html',
providers: [ QuestionControlService ] providers: [ QuestionControlService ]
}) })
export class DynamicFormComponent implements OnInit { export class DynamicFormComponent implements OnInit {

View File

@ -10,7 +10,7 @@ import { forbiddenNameValidator } from '../shared/forbidden-name.directive';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'hero-form-reactive3', selector: 'hero-form-reactive3',
templateUrl: 'hero-form-reactive.component.html' templateUrl: './hero-form-reactive.component.html'
}) })
export class HeroFormReactiveComponent implements OnInit { export class HeroFormReactiveComponent implements OnInit {

View File

@ -9,7 +9,7 @@ import { Hero } from '../shared/hero';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'hero-form-template1', selector: 'hero-form-template1',
templateUrl: 'hero-form-template1.component.html' templateUrl: './hero-form-template1.component.html'
}) })
// #docregion class // #docregion class
export class HeroFormTemplate1Component { export class HeroFormTemplate1Component {

View File

@ -9,7 +9,7 @@ import { Hero } from '../shared/hero';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'hero-form-template2', selector: 'hero-form-template2',
templateUrl: 'hero-form-template2.component.html' templateUrl: './hero-form-template2.component.html'
}) })
export class HeroFormTemplate2Component implements AfterViewChecked { export class HeroFormTemplate2Component implements AfterViewChecked {

View File

@ -4,7 +4,7 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'my-app', selector: 'my-app',
templateUrl: 'app.component.html' templateUrl: './app.component.html'
}) })
export class AppComponent { export class AppComponent {
wolves = 0; wolves = 0;

View File

@ -3,7 +3,7 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'my-app', selector: 'my-app',
templateUrl: 'app.component.html', templateUrl: './app.component.html',
styles: [ styles: [
// See hero-di-inject-additional.component // See hero-di-inject-additional.component
'hero-host, hero-host-meta { border: 1px dashed black; display: block; padding: 4px;}', 'hero-host, hero-host-meta { border: 1px dashed black; display: block; padding: 4px;}',

View File

@ -4,7 +4,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'app-confirm', selector: 'app-confirm',
templateUrl: 'confirm.component.html' templateUrl: './confirm.component.html'
}) })
export class ConfirmComponent { export class ConfirmComponent {
@Input() okMsg = ''; @Input() okMsg = '';

View File

@ -5,7 +5,7 @@ import { Attribute, Component, Inject, Optional } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'hero-title', selector: 'hero-title',
templateUrl: 'hero-title.component.html' templateUrl: './hero-title.component.html'
}) })
// #enddocregion templateUrl // #enddocregion templateUrl
export class HeroTitleComponent { export class HeroTitleComponent {

View File

@ -10,7 +10,7 @@ AppComponent.annotations = [
new Component({ new Component({
moduleId: module.id, moduleId: module.id,
selector: 'my-app', selector: 'my-app',
templateUrl: 'app.component.html', templateUrl: './app.component.html',
styles: [ styles: [
// See hero-di-inject-additional.component // See hero-di-inject-additional.component
'hero-host { border: 1px dashed black; display: block; padding: 4px;}', 'hero-host { border: 1px dashed black; display: block; padding: 4px;}',

View File

@ -18,7 +18,7 @@ ConfirmComponent.annotations = [
new Component({ new Component({
moduleId: module.id, moduleId: module.id,
selector: 'app-confirm', selector: 'app-confirm',
templateUrl: 'confirm.component.html', templateUrl: './confirm.component.html',
inputs: [ inputs: [
'okMsg', 'okMsg',
'notOkMsg: cancelMsg' 'notOkMsg: cancelMsg'

View File

@ -18,7 +18,7 @@ HeroTitleComponent.annotations = [
new Component({ new Component({
moduleId: module.id, moduleId: module.id,
selector: 'hero-title', selector: 'hero-title',
templateUrl: 'hero-title.component.html' templateUrl: './hero-title.component.html'
}) })
]; ];
// #enddocregion templateUrl // #enddocregion templateUrl

View File

@ -3,7 +3,7 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'my-app', selector: 'my-app',
templateUrl: 'app.component.html', templateUrl: './app.component.html',
styles: [ styles: [
// See hero-di-inject-additional.component // See hero-di-inject-additional.component
'hero-host, hero-host-meta { border: 1px dashed black; display: block; padding: 4px;}', 'hero-host, hero-host-meta { border: 1px dashed black; display: block; padding: 4px;}',

View File

@ -4,7 +4,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'app-confirm', selector: 'app-confirm',
templateUrl: 'confirm.component.html' templateUrl: './confirm.component.html'
}) })
export class ConfirmComponent { export class ConfirmComponent {
@Input() okMsg = ''; @Input() okMsg = '';

View File

@ -5,7 +5,7 @@ import { Attribute, Component, Inject, Optional } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'hero-title', selector: 'hero-title',
templateUrl: 'hero-title.component.html' templateUrl: './hero-title.component.html'
}) })
// #enddocregion templateUrl // #enddocregion templateUrl
export class HeroTitleComponent { export class HeroTitleComponent {

View File

@ -6,8 +6,8 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'cli-quickstart-app', selector: 'cli-quickstart-app',
templateUrl: 'cli-quickstart.component.html', templateUrl: './cli-quickstart.component.html',
styleUrls: ['cli-quickstart.component.css'] styleUrls: ['./cli-quickstart.component.css']
}) })
// #enddocregion metadata // #enddocregion metadata
// #docregion title, class // #docregion title, class

View File

@ -7,8 +7,8 @@ import { Component, ViewEncapsulation } from '@angular/core';
moduleId: module.id, moduleId: module.id,
selector: 'quest-summary', selector: 'quest-summary',
// #docregion urls // #docregion urls
templateUrl: 'quest-summary.component.html', templateUrl: './quest-summary.component.html',
styleUrls: ['quest-summary.component.css'] styleUrls: ['./quest-summary.component.css']
// #enddocregion urls // #enddocregion urls
}) })
export class QuestSummaryComponent { } export class QuestSummaryComponent { }

View File

@ -8,7 +8,7 @@ import { Hero } from './hero';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'hero-form', selector: 'hero-form',
templateUrl: 'hero-form.component.html' templateUrl: './hero-form.component.html'
}) })
export class HeroFormComponent { export class HeroFormComponent {

View File

@ -9,7 +9,7 @@ import { Component } from '@angular/core';
selector: 'hello-world', selector: 'hello-world',
// Location of the template for this component // Location of the template for this component
templateUrl: 'hello_world.html' templateUrl: './hello_world.html'
}) })
export class HelloWorldComponent { export class HelloWorldComponent {

View File

@ -3,6 +3,6 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'my-app', selector: 'my-app',
templateUrl: 'app.component.html' templateUrl: './app.component.html'
}) })
export class AppComponent { } export class AppComponent { }

View File

@ -77,7 +77,7 @@ export class DoCheckComponent implements DoCheck {
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'do-check-parent', selector: 'do-check-parent',
templateUrl: 'do-check-parent.component.html', templateUrl: './do-check-parent.component.html',
styles: ['.parent {background: Lavender}'] styles: ['.parent {background: Lavender}']
}) })
export class DoCheckParentComponent { export class DoCheckParentComponent {

View File

@ -51,7 +51,7 @@ export class OnChangesComponent implements OnChanges {
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'on-changes-parent', selector: 'on-changes-parent',
templateUrl: 'on-changes-parent.component.html', templateUrl: './on-changes-parent.component.html',
styles: ['.parent {background: Lavender;}'] styles: ['.parent {background: Lavender;}']
}) })
export class OnChangesParentComponent { export class OnChangesParentComponent {

View File

@ -6,7 +6,7 @@ import { LoggerService } from './logger.service';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'spy-parent', selector: 'spy-parent',
templateUrl: 'spy.component.html', templateUrl: './spy.component.html',
styles: [ styles: [
'.parent {background: khaki;}', '.parent {background: khaki;}',
'.heroes {background: LightYellow; padding: 0 8px}' '.heroes {background: LightYellow; padding: 0 8px}'

View File

@ -7,8 +7,8 @@ import { UserService } from '../user.service';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'app-contact', selector: 'app-contact',
templateUrl: 'contact.component.html', templateUrl: './contact.component.html',
styleUrls: [ 'contact.component.css' ] styleUrls: [ './contact.component.css' ]
}) })
export class ContactComponent implements OnInit { export class ContactComponent implements OnInit {
contact: Contact; contact: Contact;

View File

@ -8,8 +8,8 @@ import { UserService } from '../core/user.service';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'app-contact', selector: 'app-contact',
templateUrl: 'contact.component.html', templateUrl: './contact.component.html',
styleUrls: [ 'contact.component.css' ] styleUrls: [ './contact.component.css' ]
}) })
export class ContactComponent implements OnInit { export class ContactComponent implements OnInit {
contact: Contact; contact: Contact;

View File

@ -5,7 +5,7 @@ import { UserService } from '../core/user.service';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'app-title', selector: 'app-title',
templateUrl: 'title.component.html', templateUrl: './title.component.html',
}) })
export class TitleComponent { export class TitleComponent {
@Input() subtitle = ''; @Input() subtitle = '';

View File

@ -9,7 +9,7 @@ import { UserService } from './user.service';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'app-title', selector: 'app-title',
templateUrl: 'title.component.html', templateUrl: './title.component.html',
}) })
export class TitleComponent { export class TitleComponent {
@Input() subtitle = ''; @Input() subtitle = '';

View File

@ -4,7 +4,7 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'my-app', selector: 'my-app',
templateUrl: 'app.component.html' templateUrl: './app.component.html'
}) })
export class AppComponent { export class AppComponent {
birthday = new Date(1988, 3, 15); // April 15, 1988 birthday = new Date(1988, 3, 15); // April 15, 1988

View File

@ -7,7 +7,7 @@ import { HEROES } from './heroes';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'flying-heroes', selector: 'flying-heroes',
templateUrl: 'flying-heroes.component.html', templateUrl: './flying-heroes.component.html',
styles: ['#flyers, #all {font-style: italic}'] styles: ['#flyers, #all {font-style: italic}']
}) })
// #docregion v1 // #docregion v1
@ -52,7 +52,7 @@ export class FlyingHeroesComponent {
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'flying-heroes-impure', selector: 'flying-heroes-impure',
templateUrl: 'flying-heroes-impure.component.html', templateUrl: './flying-heroes-impure.component.html',
// #enddocregion impure-component // #enddocregion impure-component
styles: ['.flyers, .all {font-style: italic}'], styles: ['.flyers, .all {font-style: italic}'],
// #docregion impure-component // #docregion impure-component

View File

@ -6,7 +6,7 @@ import { slideInDownAnimation } from './animations';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
templateUrl: 'compose-message.component.html', templateUrl: './compose-message.component.html',
styles: [ ':host { position: relative; bottom: 10%; }' ], styles: [ ':host { position: relative; bottom: 10%; }' ],
animations: [ slideInDownAnimation ] animations: [ slideInDownAnimation ]
}) })

View File

@ -6,7 +6,7 @@ import { DomSanitizer, SafeResourceUrl, SafeUrl } from '@angular/platform-browse
@Component({ @Component({
selector: 'bypass-security', selector: 'bypass-security',
moduleId: module.id, moduleId: module.id,
templateUrl: 'bypass-security.component.html', templateUrl: './bypass-security.component.html',
}) })
export class BypassSecurityComponent { export class BypassSecurityComponent {
dangerousUrl: string; dangerousUrl: string;

View File

@ -4,7 +4,7 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'inner-html-binding', selector: 'inner-html-binding',
templateUrl: 'inner-html-binding.component.html', templateUrl: './inner-html-binding.component.html',
}) })
// #docregion class // #docregion class
export class InnerHtmlBindingComponent { export class InnerHtmlBindingComponent {

View File

@ -7,7 +7,7 @@ import { HeroService } from './hero.service.promise';
@Component({ @Component({
selector: 'hero-list-promise', selector: 'hero-list-promise',
moduleId: module.id, moduleId: module.id,
templateUrl: 'hero-list.component.html', templateUrl: './hero-list.component.html',
providers: [ HeroService ], providers: [ HeroService ],
styles: ['.error {color:red;}'] styles: ['.error {color:red;}']
}) })

View File

@ -7,7 +7,7 @@ import { HeroService } from './hero.service';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'hero-list', selector: 'hero-list',
templateUrl: 'hero-list.component.html', templateUrl: './hero-list.component.html',
providers: [ HeroService ], providers: [ HeroService ],
styles: ['.error {color:red;}'] styles: ['.error {color:red;}']
}) })

View File

@ -12,7 +12,7 @@ import { WikipediaService } from './wikipedia.service';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'my-wiki-smart', selector: 'my-wiki-smart',
templateUrl: 'wiki.component.html', templateUrl: './wiki.component.html',
providers: [ WikipediaService ] providers: [ WikipediaService ]
}) })
export class WikiSmartComponent implements OnInit { export class WikiSmartComponent implements OnInit {

View File

@ -5,7 +5,7 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'structural-directives', selector: 'structural-directives',
templateUrl: 'structural-directives.component.html', templateUrl: './structural-directives.component.html',
styles: ['button { min-width: 100px; }'] styles: ['button { min-width: 100px; }']
}) })
export class StructuralDirectivesComponent { export class StructuralDirectivesComponent {

View File

@ -9,7 +9,7 @@ import { HeroService } from './heroes';
template: ` template: `
<toh-heroes></toh-heroes> <toh-heroes></toh-heroes>
`, `,
styleUrls: ['app.component.css'], styleUrls: ['./app.component.css'],
providers: [ HeroService ] providers: [ HeroService ]
}) })
export class AppComponent { } export class AppComponent { }

View File

@ -6,7 +6,7 @@ import { ExceptionService, SpinnerService, ToastService } from './core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'sg-app', selector: 'sg-app',
templateUrl: 'app.component.html', templateUrl: './app.component.html',
providers: [HeroService, ExceptionService, SpinnerService, ToastService] providers: [HeroService, ExceptionService, SpinnerService, ToastService]
}) })
export class AppComponent implements OnInit { export class AppComponent implements OnInit {

View File

@ -3,7 +3,7 @@
/* avoid */ /* avoid */
import { ExceptionService, SpinnerService, ToastService } from '../../core'; import { ExceptionService, SpinnerService, ToastService } from '../../core';
import { Http, Response } from '@angular/http'; import { Http } from '@angular/http';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Hero } from './hero.model'; import { Hero } from './hero.model';
// #enddocregion example // #enddocregion example
@ -20,12 +20,12 @@ export class HeroService {
getHero(id: number) { getHero(id: number) {
return this.http.get(`api/heroes/${id}`) return this.http.get(`api/heroes/${id}`)
.map((res: Response) => res.json().data); .map(response => response.json().data as Hero);
} }
getHeroes() { getHeroes() {
return this.http.get(`api/heroes`) return this.http.get(`api/heroes`)
.map((res: Response) => res.json().data); .map(response => response.json().data as Hero[]);
} }
} }

View File

@ -1,7 +1,7 @@
// #docregion // #docregion
// #docregion example // #docregion example
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http'; import { Http } from '@angular/http';
import { Hero } from './hero.model'; import { Hero } from './hero.model';
import { ExceptionService, SpinnerService, ToastService } from '../../core'; import { ExceptionService, SpinnerService, ToastService } from '../../core';
@ -20,12 +20,12 @@ export class HeroService {
getHero(id: number) { getHero(id: number) {
return this.http.get(`api/heroes/${id}`) return this.http.get(`api/heroes/${id}`)
.map((res: Response) => res.json().data); .map(response => response.json().data as Hero);
} }
getHeroes() { getHeroes() {
return this.http.get(`api/heroes`) return this.http.get(`api/heroes`)
.map((res: Response) => res.json().data); .map(response => response.json().data as Hero[]);
} }
} }

View File

@ -4,10 +4,10 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
// #enddocregion example // #enddocregion example
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
// #docregion example // #docregion example
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { HeroesComponent } from './heroes/heroes.component'; import { HeroesComponent } from './heroes/heroes.component';
@NgModule({ @NgModule({

View File

@ -1,21 +1,12 @@
// #docplaster
// #docregion
// #docregion example
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
@Component({ @Component({
// #enddocregion example
moduleId: module.id, moduleId: module.id,
// #docregion example
selector: 'toh-heroes', selector: 'toh-heroes',
templateUrl: 'heroes.component.html' templateUrl: './heroes.component.html'
}) })
export class HeroesComponent implements OnInit { export class HeroesComponent implements OnInit {
// #enddocregion example constructor() { /* ... */ }
// #docregion example
constructor() { }
ngOnInit() { } ngOnInit() { /* ... */ }
} }
// #enddocregion example

View File

@ -1,23 +1,14 @@
// #docplaster
// #docregion // #docregion
// #docregion example import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { FilterTextService } from '../shared/filter-text/filter-text.service'; import { FilterTextService } from '../shared/filter-text/filter-text.service';
@Component({ @Component({
// #enddocregion example
moduleId: module.id, moduleId: module.id,
// #docregion example
selector: 'toh-heroes', selector: 'toh-heroes',
templateUrl: 'heroes.component.html' templateUrl: './heroes.component.html'
}) })
export class HeroesComponent implements OnInit { export class HeroesComponent {
// #enddocregion example
// #docregion example
filteredHeroes: any[] = [];
constructor(private filterService: FilterTextService) { }
heroes = [ heroes = [
{ id: 1, name: 'Windstorm' }, { id: 1, name: 'Windstorm' },
@ -26,13 +17,12 @@ export class HeroesComponent implements OnInit {
{ id: 4, name: 'Tornado' } { id: 4, name: 'Tornado' }
]; ];
filteredHeroes = this.heroes;
constructor(private filterService: FilterTextService) { }
filterChanged(searchText: string) { filterChanged(searchText: string) {
this.filteredHeroes = this.filterService.filter(searchText, ['id', 'name'], this.heroes); this.filteredHeroes = this.filterService.filter(searchText, ['id', 'name'], this.heroes);
} }
ngOnInit() {
this.filteredHeroes = this.heroes;
}
} }
// #enddocregion example

View File

@ -4,8 +4,8 @@ import { Component, OnInit } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'toh-nav', selector: 'toh-nav',
templateUrl: 'nav.component.html', templateUrl: './nav.component.html',
styleUrls: ['nav.component.css'], styleUrls: ['./nav.component.css'],
}) })
export class NavComponent implements OnInit { export class NavComponent implements OnInit {
menuItems = [ menuItems = [

View File

@ -8,8 +8,8 @@ import { SpinnerState, SpinnerService } from './spinner.service';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'toh-spinner', selector: 'toh-spinner',
templateUrl: 'spinner.component.html', templateUrl: './spinner.component.html',
styleUrls: ['spinner.component.css'] styleUrls: ['./spinner.component.css']
}) })
export class SpinnerComponent implements OnDestroy, OnInit { export class SpinnerComponent implements OnDestroy, OnInit {
visible = false; visible = false;

View File

@ -1,21 +1,14 @@
// #docplaster
// #docregion
// #docregion example
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { LoggerService } from '../core/logger.service'; import { LoggerService } from '../core/logger.service';
import { SpinnerService } from '../core/spinner/spinner.service'; import { SpinnerService } from '../core/spinner/spinner.service';
@Component({ @Component({
// #enddocregion example
moduleId: module.id, moduleId: module.id,
// #docregion example
selector: 'toh-heroes', selector: 'toh-heroes',
templateUrl: 'heroes.component.html' templateUrl: './heroes.component.html'
}) })
export class HeroesComponent { export class HeroesComponent {
// #enddocregion example
// #docregion example
heroes: any[]; heroes: any[];
constructor( constructor(
@ -38,4 +31,3 @@ export class HeroesComponent {
}, 2000); }, 2000);
} }
} }
// #enddocregion example

View File

@ -4,8 +4,8 @@ import { Component, OnInit } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'toh-nav', selector: 'toh-nav',
templateUrl: 'nav.component.html', templateUrl: './nav.component.html',
styleUrls: ['nav.component.css'], styleUrls: ['./nav.component.css'],
}) })
export class NavComponent implements OnInit { export class NavComponent implements OnInit {
menuItems = [ menuItems = [

View File

@ -1,20 +1,13 @@
// #docplaster
// #docregion
// #docregion example
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { LoggerService } from '../core/logger.service'; import { LoggerService } from '../core/logger.service';
@Component({ @Component({
// #enddocregion example
moduleId: module.id, moduleId: module.id,
// #docregion example
selector: 'toh-heroes', selector: 'toh-heroes',
templateUrl: 'heroes.component.html' templateUrl: './heroes.component.html'
}) })
export class HeroesComponent { export class HeroesComponent {
// #enddocregion example
// #docregion example
heroes: any[]; heroes: any[];
constructor(private loggerService: LoggerService) { } constructor(private loggerService: LoggerService) { }
@ -30,4 +23,3 @@ export class HeroesComponent {
this.loggerService.log(`We have ${HeroesComponent.length} heroes`); this.loggerService.log(`We have ${HeroesComponent.length} heroes`);
} }
} }
// #enddocregion example

View File

@ -3,6 +3,6 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'sg-app', selector: 'sg-app',
templateUrl: 'app.component.html' templateUrl: './app.component.html'
}) })
export class AppComponent { } export class AppComponent { }

View File

@ -1,15 +1,12 @@
// #docplaster // #docplaster
// #docregion
import { Component } from '@angular/core'; import { Component } from '@angular/core';
// #docregion example // #docregion example
/* avoid */ /* avoid */
@Component({ @Component({
// #enddocregion example
moduleId: module.id, moduleId: module.id,
// #docregion example
selector: 'tohHeroButton', selector: 'tohHeroButton',
templateUrl: 'hero-button.component.html' templateUrl: './hero-button.component.html'
}) })
export class HeroButtonComponent {} export class HeroButtonComponent {}
// #enddocregion example // #enddocregion example

View File

@ -1,14 +1,10 @@
// #docplaster
// #docregion
import { Component } from '@angular/core'; import { Component } from '@angular/core';
// #docregion example // #docregion example
@Component({ @Component({
// #enddocregion example
moduleId: module.id, moduleId: module.id,
// #docregion example
selector: 'toh-hero-button', selector: 'toh-hero-button',
templateUrl: 'hero-button.component.html' templateUrl: './hero-button.component.html'
}) })
export class HeroButtonComponent {} export class HeroButtonComponent {}
// #enddocregion example // #enddocregion example

View File

@ -3,6 +3,6 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'sg-app', selector: 'sg-app',
templateUrl: 'app.component.html' templateUrl: './app.component.html'
}) })
export class AppComponent { } export class AppComponent { }

View File

@ -1,15 +1,11 @@
// #docplaster
// #docregion
import { Component } from '@angular/core'; import { Component } from '@angular/core';
// #docregion example // #docregion example
/* avoid */ /* avoid */
@Component({ @Component({
// #enddocregion example
moduleId: module.id, moduleId: module.id,
// #docregion example
selector: '[tohHeroButton]', selector: '[tohHeroButton]',
templateUrl: 'hero-button.component.html' templateUrl: './hero-button.component.html'
}) })
export class HeroButtonComponent {} export class HeroButtonComponent {}
// #enddocregion example // #enddocregion example

View File

@ -1,14 +1,10 @@
// #docplaster
// #docregion
import { Component } from '@angular/core'; import { Component } from '@angular/core';
// #docregion example // #docregion example
@Component({ @Component({
// #enddocregion example
moduleId: module.id, moduleId: module.id,
// #docregion example
selector: 'toh-hero-button', selector: 'toh-hero-button',
templateUrl: 'hero-button.component.html' templateUrl: './hero-button.component.html'
}) })
export class HeroButtonComponent {} export class HeroButtonComponent {}
// #enddocregion example // #enddocregion example

View File

@ -1,9 +1,10 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { HeroesComponent } from './heroes'; import { HeroesComponent } from './heroes';
import { HeroService } from './heroes/shared';
@NgModule({ @NgModule({
imports: [ imports: [
@ -14,6 +15,7 @@ import { HeroesComponent } from './heroes';
AppComponent, AppComponent,
HeroesComponent HeroesComponent
], ],
exports: [ AppComponent ] exports: [ AppComponent ],
providers: [ HeroService ]
}) })
export class AppModule {} export class AppModule {}

View File

@ -1,7 +1,8 @@
// #docregion
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Hero, HeroService } from './shared';
import { Hero } from './shared/hero.model';
// #docregion example // #docregion example
/* avoid */ /* avoid */
@ -11,7 +12,7 @@ import { Hero } from './shared/hero.model';
<div> <div>
<h2>My Heroes</h2> <h2>My Heroes</h2>
<ul class="heroes"> <ul class="heroes">
<li *ngFor="let hero of heroes"> <li *ngFor="let hero of heroes | async" (click)="selectedHero=hero">
<span class="badge">{{hero.id}}</span> {{hero.name}} <span class="badge">{{hero.id}}</span> {{hero.name}}
</li> </li>
</ul> </ul>
@ -51,9 +52,13 @@ import { Hero } from './shared/hero.model';
`] `]
}) })
export class HeroesComponent implements OnInit { export class HeroesComponent implements OnInit {
heroes: Hero[]; heroes: Observable<Hero[]>;
selectedHero: Hero; selectedHero: Hero;
ngOnInit() {} constructor(private heroService: HeroService) { }
ngOnInit() {
this.heroes = this.heroService.getHeroes();
}
} }
// #enddocregion example // #enddocregion example

View File

@ -2,7 +2,7 @@
<div> <div>
<h2>My Heroes</h2> <h2>My Heroes</h2>
<ul class="heroes"> <ul class="heroes">
<li *ngFor="let hero of heroes"> <li *ngFor="let hero of heroes | async" (click)="selectedHero=hero">
<span class="badge">{{hero.id}}</span> {{hero.name}} <span class="badge">{{hero.id}}</span> {{hero.name}}
</li> </li>
</ul> </ul>

View File

@ -1,22 +1,23 @@
// #docplaster
// #docregion
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Hero } from './shared'; import { Hero, HeroService } from './shared';
// #docregion example // #docregion example
@Component({ @Component({
// #enddocregion example
moduleId: module.id, moduleId: module.id,
// #docregion example
selector: 'toh-heroes', selector: 'toh-heroes',
templateUrl: 'heroes.component.html', templateUrl: './heroes.component.html',
styleUrls: ['heroes.component.css'] styleUrls: ['./heroes.component.css']
}) })
export class HeroesComponent implements OnInit { export class HeroesComponent implements OnInit {
heroes: Hero[]; heroes: Observable<Hero[]>;
selectedHero: Hero; selectedHero: Hero;
ngOnInit() { } constructor(private heroService: HeroService) { }
ngOnInit() {
this.heroes = this.heroService.getHeroes();
}
} }
// #enddocregion example // #enddocregion example

View File

@ -0,0 +1,18 @@
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import { Hero } from './hero.model';
@Injectable()
export class HeroService {
constructor(private http: Http) {}
getHeroes(): Observable<Hero[]> {
return this.http.get('api/heroes')
.map(resp => resp.json().data as Hero[]);
}
}

View File

@ -1 +1,2 @@
export * from './hero.model'; export * from './hero.model';
export * from './hero.service';

View File

@ -1,3 +1,6 @@
<!-- #docregion --> <!-- #docregion -->
<toh-hero-button label="OK" (change)="doSomething()"> <toh-hero-button label="OK" (change)="doSomething()">
</toh-hero-button> </toh-hero-button>
<!-- `heroHighlight` is both the directive name and the data-bound aliased property name -->
<h3 heroHighlight="skyblue">The Great Bombasto</h3>

View File

@ -3,6 +3,6 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'sg-app', selector: 'sg-app',
templateUrl: 'app.component.html' templateUrl: './app.component.html'
}) })
export class AppComponent { } export class AppComponent { }

View File

@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { HeroButtonComponent } from './heroes'; import { HeroButtonComponent, HeroHighlightDirective } from './heroes';
@NgModule({ @NgModule({
imports: [ imports: [
@ -10,7 +10,7 @@ import { HeroButtonComponent } from './heroes';
], ],
declarations: [ declarations: [
AppComponent, AppComponent,
HeroButtonComponent HeroButtonComponent, HeroHighlightDirective
], ],
exports: [ AppComponent ] exports: [ AppComponent ]
}) })

View File

@ -1,13 +1,13 @@
// #docregion
import { Component, EventEmitter, Input, Output } from '@angular/core'; import { Component, EventEmitter, Input, Output } from '@angular/core';
// #docregion example // #docregion example
/* avoid */ /* avoid pointless aliasing */
@Component({ @Component({
selector: 'toh-hero-button', selector: 'toh-hero-button',
template: `<button>{{label}}</button>` template: `<button>{{label}}</button>`
}) })
export class HeroButtonComponent { export class HeroButtonComponent {
// Pointless aliases
@Output('changeEvent') change = new EventEmitter<any>(); @Output('changeEvent') change = new EventEmitter<any>();
@Input('labelAttribute') label: string; @Input('labelAttribute') label: string;
} }

View File

@ -7,6 +7,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
template: `<button>{{label}}</button>` template: `<button>{{label}}</button>`
}) })
export class HeroButtonComponent { export class HeroButtonComponent {
// No aliases
@Output() change = new EventEmitter<any>(); @Output() change = new EventEmitter<any>();
@Input() label: string; @Input() label: string;
} }

View File

@ -0,0 +1,15 @@
// #docregion
import { Directive, ElementRef, Input, OnChanges } from '@angular/core';
@Directive({ selector: '[heroHighlight]' })
export class HeroHighlightDirective implements OnChanges {
// Aliased because `color` is a better property name than `heroHighlight`
@Input('heroHighlight') color: string;
constructor(private el: ElementRef) {}
ngOnChanges() {
this.el.nativeElement.style.backgroundColor = this.color || 'yellow';
}
}

View File

@ -1 +1,2 @@
export * from './hero-button'; export * from './hero-button';
export * from './hero-highlight.directive';

View File

@ -3,6 +3,6 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'sg-app', selector: 'sg-app',
templateUrl: 'app.component.html' templateUrl: './app.component.html'
}) })
export class AppComponent { } export class AppComponent { }

View File

@ -3,6 +3,6 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'sg-app', selector: 'sg-app',
templateUrl: 'app.component.html' templateUrl: './app.component.html'
}) })
export class AppComponent { } export class AppComponent { }

View File

@ -5,7 +5,7 @@ import { Hero, HeroService } from './heroes';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'sg-app', selector: 'sg-app',
templateUrl: 'app.component.html', templateUrl: './app.component.html',
providers: [HeroService] providers: [HeroService]
}) })
export class AppComponent implements OnInit { export class AppComponent implements OnInit {

View File

@ -3,6 +3,6 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'my-app', selector: 'my-app',
templateUrl: 'app.component.html' templateUrl: './app.component.html'
}) })
export class AppComponent { } export class AppComponent { }

View File

@ -19,7 +19,7 @@ export enum Color {Red, Green, Blue};
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'my-app', selector: 'my-app',
templateUrl: 'app.component.html' templateUrl: './app.component.html'
}) })
export class AppComponent implements AfterViewInit, OnInit { export class AppComponent implements AfterViewInit, OnInit {

View File

@ -3,6 +3,6 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'my-app', selector: 'my-app',
templateUrl: 'app.component.html' templateUrl: './app.component.html'
}) })
export class AppComponent { } export class AppComponent { }

View File

@ -251,7 +251,7 @@ export class TestViewProvidersComponent {
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'external-template-comp', selector: 'external-template-comp',
templateUrl: 'bag-external-template.html' templateUrl: './bag-external-template.html'
}) })
export class ExternalTemplateComponent implements OnInit { export class ExternalTemplateComponent implements OnInit {
serviceValue: string; serviceValue: string;
@ -275,7 +275,7 @@ export class InnerCompWithExternalTemplateComponent { }
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'bad-template-comp', selector: 'bad-template-comp',
templateUrl: 'non-existant.html' templateUrl: './non-existant.html'
}) })
export class BadTemplateUrlComponent { } export class BadTemplateUrlComponent { }

View File

@ -4,8 +4,8 @@ import { Component } from '@angular/core';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'app-banner', selector: 'app-banner',
templateUrl: 'banner.component.html', templateUrl: './banner.component.html',
styleUrls: ['banner.component.css'] styleUrls: ['./banner.component.css']
}) })
export class BannerComponent { export class BannerComponent {
title = 'Test Tour of Heroes'; title = 'Test Tour of Heroes';

View File

@ -7,8 +7,8 @@ import { Hero } from '../model';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'dashboard-hero', selector: 'dashboard-hero',
templateUrl: 'dashboard-hero.component.html', templateUrl: './dashboard-hero.component.html',
styleUrls: [ 'dashboard-hero.component.css' ] styleUrls: [ './dashboard-hero.component.css' ]
}) })
export class DashboardHeroComponent { export class DashboardHeroComponent {
@Input() hero: Hero; @Input() hero: Hero;

View File

@ -7,8 +7,8 @@ import { Hero, HeroService } from '../model';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'app-dashboard', selector: 'app-dashboard',
templateUrl: 'dashboard.component.html', templateUrl: './dashboard.component.html',
styleUrls: [ 'dashboard.component.css' ] styleUrls: [ './dashboard.component.css' ]
}) })
export class DashboardComponent implements OnInit { export class DashboardComponent implements OnInit {

View File

@ -11,8 +11,8 @@ import { HeroDetailService } from './hero-detail.service';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'app-hero-detail', selector: 'app-hero-detail',
templateUrl: 'hero-detail.component.html', templateUrl: './hero-detail.component.html',
styleUrls: ['hero-detail.component.css' ], styleUrls: ['./hero-detail.component.css' ],
providers: [ HeroDetailService ] providers: [ HeroDetailService ]
}) })
export class HeroDetailComponent implements OnInit { export class HeroDetailComponent implements OnInit {

View File

@ -6,8 +6,8 @@ import { Hero, HeroService } from '../model';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'app-heroes', selector: 'app-heroes',
templateUrl: 'hero-list.component.html', templateUrl: './hero-list.component.html',
styleUrls: [ 'hero-list.component.css' ] styleUrls: [ './hero-list.component.css' ]
}) })
export class HeroListComponent implements OnInit { export class HeroListComponent implements OnInit {
heroes: Promise<Hero[]>; heroes: Promise<Hero[]>;

View File

@ -15,7 +15,7 @@ import { Component } from '@angular/core';
`, `,
// #enddocregion template // #enddocregion template
// #docregion styleUrls // #docregion styleUrls
styleUrls: ['app.component.css'], styleUrls: ['./app.component.css'],
// #enddocregion styleUrls // #enddocregion styleUrls
}) })
export class AppComponent { export class AppComponent {

Some files were not shown because too many files have changed in this diff Show More