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:
commit
0d5877db1c
|
@ -23,7 +23,7 @@ import { Heroes } from './hero.service';
|
|||
</ul>
|
||||
`,
|
||||
// #enddocregion template
|
||||
styleUrls: ['hero-list.component.css'],
|
||||
styleUrls: ['./hero-list.component.css'],
|
||||
|
||||
/* When the element leaves (transition "in => void" occurs),
|
||||
* get the element's current computed height and animate
|
||||
|
|
|
@ -34,7 +34,7 @@ import { Heroes } from './hero.service';
|
|||
</ul>
|
||||
`,
|
||||
// #enddocregion template
|
||||
styleUrls: ['hero-list.component.css'],
|
||||
styleUrls: ['./hero-list.component.css'],
|
||||
// #enddocregion
|
||||
/**
|
||||
* Define two states, "inactive" and "active", and the end
|
||||
|
|
|
@ -27,7 +27,7 @@ import { Heroes } from './hero.service';
|
|||
</ul>
|
||||
`,
|
||||
// #enddocregion template
|
||||
styleUrls: ['hero-list.component.css'],
|
||||
styleUrls: ['./hero-list.component.css'],
|
||||
/*
|
||||
* Define two states, "inactive" and "active", and the end
|
||||
* styles that apply whenever the element is in those states.
|
||||
|
|
|
@ -24,7 +24,7 @@ import { Heroes } from './hero.service';
|
|||
</ul>
|
||||
`,
|
||||
// #enddocregion template
|
||||
styleUrls: ['hero-list.component.css'],
|
||||
styleUrls: ['./hero-list.component.css'],
|
||||
/* The elements here have two possible states based
|
||||
* on the hero state, "active", or "inactive". We animate
|
||||
* six transitions: Between the two states in both directions,
|
||||
|
|
|
@ -23,7 +23,7 @@ import { Heroes } from './hero.service';
|
|||
</ul>
|
||||
`,
|
||||
// #enddocregion template
|
||||
styleUrls: ['hero-list.component.css'],
|
||||
styleUrls: ['./hero-list.component.css'],
|
||||
/* The element here always has the state "in" when it
|
||||
* is present. We animate two transitions: From void
|
||||
* to in and from in to void, to achieve an animated
|
||||
|
|
|
@ -22,7 +22,7 @@ import { Heroes } from './hero.service';
|
|||
</li>
|
||||
</ul>
|
||||
`,
|
||||
styleUrls: ['hero-list.component.css'],
|
||||
styleUrls: ['./hero-list.component.css'],
|
||||
styles: [`
|
||||
li {
|
||||
padding: 0 !important;
|
||||
|
|
|
@ -26,7 +26,7 @@ import { Heroes } from './hero.service';
|
|||
</ul>
|
||||
`,
|
||||
// #enddocregion template
|
||||
styleUrls: ['hero-list.component.css'],
|
||||
styleUrls: ['./hero-list.component.css'],
|
||||
/**
|
||||
* Define two states, "inactive" and "active", and the end
|
||||
* styles that apply whenever the element is in those states.
|
||||
|
|
|
@ -27,7 +27,7 @@ import { Heroes } from './hero.service';
|
|||
</ul>
|
||||
`,
|
||||
// #enddocregion template
|
||||
styleUrls: ['hero-list.component.css'],
|
||||
styleUrls: ['./hero-list.component.css'],
|
||||
/* The element here always has the state "in" when it
|
||||
* is present. We animate two transitions: From void
|
||||
* to in and from in to void, to achieve an animated
|
||||
|
|
|
@ -22,7 +22,7 @@ import { Heroes } from './hero.service';
|
|||
</li>
|
||||
</ul>
|
||||
`,
|
||||
styleUrls: ['hero-list.component.css'],
|
||||
styleUrls: ['./hero-list.component.css'],
|
||||
/* The element here always has the state "in" when it
|
||||
* is present. We animate two transitions: From void
|
||||
* to in and from in to void, to achieve an animated
|
||||
|
|
|
@ -27,7 +27,7 @@ import { Heroes } from './hero.service';
|
|||
</ul>
|
||||
`,
|
||||
// #enddocregion template
|
||||
styleUrls: ['hero-list.component.css'],
|
||||
styleUrls: ['./hero-list.component.css'],
|
||||
/*
|
||||
* Define two states, "inactive" and "active", and the end
|
||||
* styles that apply whenever the element is in those states.
|
||||
|
|
|
@ -5,7 +5,7 @@ import { Hero } from './hero';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-detail',
|
||||
templateUrl: 'hero-detail.component.html'
|
||||
templateUrl: './hero-detail.component.html'
|
||||
})
|
||||
export class HeroDetailComponent {
|
||||
@Input() hero: Hero;
|
||||
|
|
|
@ -7,7 +7,7 @@ import { HeroService } from './hero.service';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-list',
|
||||
templateUrl: 'hero-list.component.html',
|
||||
templateUrl: './hero-list.component.html',
|
||||
providers: [ HeroService ]
|
||||
})
|
||||
// #enddocregion providers
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: 'app.component.1.html'
|
||||
templateUrl: './app.component.1.html'
|
||||
})
|
||||
// #docregion class
|
||||
export class AppComponent {
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: 'app.component.html'
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
// #docregion class
|
||||
export class AppComponent {
|
||||
|
|
|
@ -6,8 +6,8 @@ import { IMovie } from './movie';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: 'app.component.html',
|
||||
styleUrls: [ 'app.component.css' ],
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: [ './app.component.css' ],
|
||||
providers: [ MovieService ]
|
||||
})
|
||||
export class AppComponent {
|
||||
|
|
|
@ -10,10 +10,10 @@ import { MovieService } from './movie.service';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'movie-list',
|
||||
templateUrl: 'movie-list.component.html',
|
||||
templateUrl: './movie-list.component.html',
|
||||
// #enddocregion component
|
||||
// #docregion style-url
|
||||
styleUrls: [ 'movie-list.component.css' ],
|
||||
styleUrls: [ './movie-list.component.css' ],
|
||||
// #enddocregion style-url
|
||||
})
|
||||
// #enddocregion component
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: 'app.component.html'
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
export class AppComponent {
|
||||
showHeading = true;
|
||||
|
|
|
@ -3,6 +3,6 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: 'app.component.html'
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
export class AppComponent { }
|
||||
|
|
|
@ -24,8 +24,8 @@ export class SomeAbsoluteComponent {
|
|||
moduleId: module.id,
|
||||
// #enddocregion module-id
|
||||
selector: 'relative-path',
|
||||
templateUrl: 'some.component.html',
|
||||
styleUrls: ['some.component.css']
|
||||
templateUrl: './some.component.html',
|
||||
styleUrls: ['./some.component.css']
|
||||
})
|
||||
// #enddocregion relative-config
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import { UserService } from './user.service';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: 'app.component.html',
|
||||
templateUrl: './app.component.html',
|
||||
// #docregion providers
|
||||
providers: [ LoggerService, UserContextService, UserService ]
|
||||
// #enddocregion providers
|
||||
|
|
|
@ -7,7 +7,7 @@ import { QuestionBase } from './question-base';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'df-question',
|
||||
templateUrl: 'dynamic-form-question.component.html'
|
||||
templateUrl: './dynamic-form-question.component.html'
|
||||
})
|
||||
export class DynamicFormQuestionComponent {
|
||||
@Input() question: QuestionBase<any>;
|
||||
|
|
|
@ -8,7 +8,7 @@ import { QuestionControlService } from './question-control.service';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'dynamic-form',
|
||||
templateUrl: 'dynamic-form.component.html',
|
||||
templateUrl: './dynamic-form.component.html',
|
||||
providers: [ QuestionControlService ]
|
||||
})
|
||||
export class DynamicFormComponent implements OnInit {
|
||||
|
|
|
@ -10,7 +10,7 @@ import { forbiddenNameValidator } from '../shared/forbidden-name.directive';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-form-reactive3',
|
||||
templateUrl: 'hero-form-reactive.component.html'
|
||||
templateUrl: './hero-form-reactive.component.html'
|
||||
})
|
||||
export class HeroFormReactiveComponent implements OnInit {
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import { Hero } from '../shared/hero';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-form-template1',
|
||||
templateUrl: 'hero-form-template1.component.html'
|
||||
templateUrl: './hero-form-template1.component.html'
|
||||
})
|
||||
// #docregion class
|
||||
export class HeroFormTemplate1Component {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { Hero } from '../shared/hero';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-form-template2',
|
||||
templateUrl: 'hero-form-template2.component.html'
|
||||
templateUrl: './hero-form-template2.component.html'
|
||||
})
|
||||
export class HeroFormTemplate2Component implements AfterViewChecked {
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: 'app.component.html'
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
export class AppComponent {
|
||||
wolves = 0;
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: 'app.component.html',
|
||||
templateUrl: './app.component.html',
|
||||
styles: [
|
||||
// See hero-di-inject-additional.component
|
||||
'hero-host, hero-host-meta { border: 1px dashed black; display: block; padding: 4px;}',
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-confirm',
|
||||
templateUrl: 'confirm.component.html'
|
||||
templateUrl: './confirm.component.html'
|
||||
})
|
||||
export class ConfirmComponent {
|
||||
@Input() okMsg = '';
|
||||
|
|
|
@ -5,7 +5,7 @@ import { Attribute, Component, Inject, Optional } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-title',
|
||||
templateUrl: 'hero-title.component.html'
|
||||
templateUrl: './hero-title.component.html'
|
||||
})
|
||||
// #enddocregion templateUrl
|
||||
export class HeroTitleComponent {
|
||||
|
|
|
@ -10,7 +10,7 @@ AppComponent.annotations = [
|
|||
new Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: 'app.component.html',
|
||||
templateUrl: './app.component.html',
|
||||
styles: [
|
||||
// See hero-di-inject-additional.component
|
||||
'hero-host { border: 1px dashed black; display: block; padding: 4px;}',
|
||||
|
|
|
@ -18,7 +18,7 @@ ConfirmComponent.annotations = [
|
|||
new Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-confirm',
|
||||
templateUrl: 'confirm.component.html',
|
||||
templateUrl: './confirm.component.html',
|
||||
inputs: [
|
||||
'okMsg',
|
||||
'notOkMsg: cancelMsg'
|
||||
|
|
|
@ -18,7 +18,7 @@ HeroTitleComponent.annotations = [
|
|||
new Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-title',
|
||||
templateUrl: 'hero-title.component.html'
|
||||
templateUrl: './hero-title.component.html'
|
||||
})
|
||||
];
|
||||
// #enddocregion templateUrl
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: 'app.component.html',
|
||||
templateUrl: './app.component.html',
|
||||
styles: [
|
||||
// See hero-di-inject-additional.component
|
||||
'hero-host, hero-host-meta { border: 1px dashed black; display: block; padding: 4px;}',
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-confirm',
|
||||
templateUrl: 'confirm.component.html'
|
||||
templateUrl: './confirm.component.html'
|
||||
})
|
||||
export class ConfirmComponent {
|
||||
@Input() okMsg = '';
|
||||
|
|
|
@ -5,7 +5,7 @@ import { Attribute, Component, Inject, Optional } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-title',
|
||||
templateUrl: 'hero-title.component.html'
|
||||
templateUrl: './hero-title.component.html'
|
||||
})
|
||||
// #enddocregion templateUrl
|
||||
export class HeroTitleComponent {
|
||||
|
|
|
@ -6,8 +6,8 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'cli-quickstart-app',
|
||||
templateUrl: 'cli-quickstart.component.html',
|
||||
styleUrls: ['cli-quickstart.component.css']
|
||||
templateUrl: './cli-quickstart.component.html',
|
||||
styleUrls: ['./cli-quickstart.component.css']
|
||||
})
|
||||
// #enddocregion metadata
|
||||
// #docregion title, class
|
||||
|
|
|
@ -7,8 +7,8 @@ import { Component, ViewEncapsulation } from '@angular/core';
|
|||
moduleId: module.id,
|
||||
selector: 'quest-summary',
|
||||
// #docregion urls
|
||||
templateUrl: 'quest-summary.component.html',
|
||||
styleUrls: ['quest-summary.component.css']
|
||||
templateUrl: './quest-summary.component.html',
|
||||
styleUrls: ['./quest-summary.component.css']
|
||||
// #enddocregion urls
|
||||
})
|
||||
export class QuestSummaryComponent { }
|
||||
|
|
|
@ -8,7 +8,7 @@ import { Hero } from './hero';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-form',
|
||||
templateUrl: 'hero-form.component.html'
|
||||
templateUrl: './hero-form.component.html'
|
||||
})
|
||||
export class HeroFormComponent {
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import { Component } from '@angular/core';
|
|||
selector: 'hello-world',
|
||||
|
||||
// Location of the template for this component
|
||||
templateUrl: 'hello_world.html'
|
||||
templateUrl: './hello_world.html'
|
||||
})
|
||||
export class HelloWorldComponent {
|
||||
|
||||
|
|
|
@ -3,6 +3,6 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: 'app.component.html'
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
export class AppComponent { }
|
||||
|
|
|
@ -77,7 +77,7 @@ export class DoCheckComponent implements DoCheck {
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'do-check-parent',
|
||||
templateUrl: 'do-check-parent.component.html',
|
||||
templateUrl: './do-check-parent.component.html',
|
||||
styles: ['.parent {background: Lavender}']
|
||||
})
|
||||
export class DoCheckParentComponent {
|
||||
|
|
|
@ -51,7 +51,7 @@ export class OnChangesComponent implements OnChanges {
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'on-changes-parent',
|
||||
templateUrl: 'on-changes-parent.component.html',
|
||||
templateUrl: './on-changes-parent.component.html',
|
||||
styles: ['.parent {background: Lavender;}']
|
||||
})
|
||||
export class OnChangesParentComponent {
|
||||
|
|
|
@ -6,7 +6,7 @@ import { LoggerService } from './logger.service';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'spy-parent',
|
||||
templateUrl: 'spy.component.html',
|
||||
templateUrl: './spy.component.html',
|
||||
styles: [
|
||||
'.parent {background: khaki;}',
|
||||
'.heroes {background: LightYellow; padding: 0 8px}'
|
||||
|
|
|
@ -7,8 +7,8 @@ import { UserService } from '../user.service';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-contact',
|
||||
templateUrl: 'contact.component.html',
|
||||
styleUrls: [ 'contact.component.css' ]
|
||||
templateUrl: './contact.component.html',
|
||||
styleUrls: [ './contact.component.css' ]
|
||||
})
|
||||
export class ContactComponent implements OnInit {
|
||||
contact: Contact;
|
||||
|
|
|
@ -8,8 +8,8 @@ import { UserService } from '../core/user.service';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-contact',
|
||||
templateUrl: 'contact.component.html',
|
||||
styleUrls: [ 'contact.component.css' ]
|
||||
templateUrl: './contact.component.html',
|
||||
styleUrls: [ './contact.component.css' ]
|
||||
})
|
||||
export class ContactComponent implements OnInit {
|
||||
contact: Contact;
|
||||
|
|
|
@ -5,7 +5,7 @@ import { UserService } from '../core/user.service';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-title',
|
||||
templateUrl: 'title.component.html',
|
||||
templateUrl: './title.component.html',
|
||||
})
|
||||
export class TitleComponent {
|
||||
@Input() subtitle = '';
|
||||
|
|
|
@ -9,7 +9,7 @@ import { UserService } from './user.service';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-title',
|
||||
templateUrl: 'title.component.html',
|
||||
templateUrl: './title.component.html',
|
||||
})
|
||||
export class TitleComponent {
|
||||
@Input() subtitle = '';
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: 'app.component.html'
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
export class AppComponent {
|
||||
birthday = new Date(1988, 3, 15); // April 15, 1988
|
||||
|
|
|
@ -7,7 +7,7 @@ import { HEROES } from './heroes';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'flying-heroes',
|
||||
templateUrl: 'flying-heroes.component.html',
|
||||
templateUrl: './flying-heroes.component.html',
|
||||
styles: ['#flyers, #all {font-style: italic}']
|
||||
})
|
||||
// #docregion v1
|
||||
|
@ -52,7 +52,7 @@ export class FlyingHeroesComponent {
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'flying-heroes-impure',
|
||||
templateUrl: 'flying-heroes-impure.component.html',
|
||||
templateUrl: './flying-heroes-impure.component.html',
|
||||
// #enddocregion impure-component
|
||||
styles: ['.flyers, .all {font-style: italic}'],
|
||||
// #docregion impure-component
|
||||
|
|
|
@ -6,7 +6,7 @@ import { slideInDownAnimation } from './animations';
|
|||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
templateUrl: 'compose-message.component.html',
|
||||
templateUrl: './compose-message.component.html',
|
||||
styles: [ ':host { position: relative; bottom: 10%; }' ],
|
||||
animations: [ slideInDownAnimation ]
|
||||
})
|
||||
|
|
|
@ -6,7 +6,7 @@ import { DomSanitizer, SafeResourceUrl, SafeUrl } from '@angular/platform-browse
|
|||
@Component({
|
||||
selector: 'bypass-security',
|
||||
moduleId: module.id,
|
||||
templateUrl: 'bypass-security.component.html',
|
||||
templateUrl: './bypass-security.component.html',
|
||||
})
|
||||
export class BypassSecurityComponent {
|
||||
dangerousUrl: string;
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'inner-html-binding',
|
||||
templateUrl: 'inner-html-binding.component.html',
|
||||
templateUrl: './inner-html-binding.component.html',
|
||||
})
|
||||
// #docregion class
|
||||
export class InnerHtmlBindingComponent {
|
||||
|
|
|
@ -7,7 +7,7 @@ import { HeroService } from './hero.service.promise';
|
|||
@Component({
|
||||
selector: 'hero-list-promise',
|
||||
moduleId: module.id,
|
||||
templateUrl: 'hero-list.component.html',
|
||||
templateUrl: './hero-list.component.html',
|
||||
providers: [ HeroService ],
|
||||
styles: ['.error {color:red;}']
|
||||
})
|
||||
|
|
|
@ -7,7 +7,7 @@ import { HeroService } from './hero.service';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'hero-list',
|
||||
templateUrl: 'hero-list.component.html',
|
||||
templateUrl: './hero-list.component.html',
|
||||
providers: [ HeroService ],
|
||||
styles: ['.error {color:red;}']
|
||||
})
|
||||
|
|
|
@ -12,7 +12,7 @@ import { WikipediaService } from './wikipedia.service';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-wiki-smart',
|
||||
templateUrl: 'wiki.component.html',
|
||||
templateUrl: './wiki.component.html',
|
||||
providers: [ WikipediaService ]
|
||||
})
|
||||
export class WikiSmartComponent implements OnInit {
|
||||
|
|
|
@ -5,7 +5,7 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'structural-directives',
|
||||
templateUrl: 'structural-directives.component.html',
|
||||
templateUrl: './structural-directives.component.html',
|
||||
styles: ['button { min-width: 100px; }']
|
||||
})
|
||||
export class StructuralDirectivesComponent {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { HeroService } from './heroes';
|
|||
template: `
|
||||
<toh-heroes></toh-heroes>
|
||||
`,
|
||||
styleUrls: ['app.component.css'],
|
||||
styleUrls: ['./app.component.css'],
|
||||
providers: [ HeroService ]
|
||||
})
|
||||
export class AppComponent { }
|
||||
|
|
|
@ -6,7 +6,7 @@ import { ExceptionService, SpinnerService, ToastService } from './core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'sg-app',
|
||||
templateUrl: 'app.component.html',
|
||||
templateUrl: './app.component.html',
|
||||
providers: [HeroService, ExceptionService, SpinnerService, ToastService]
|
||||
})
|
||||
export class AppComponent implements OnInit {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
/* avoid */
|
||||
|
||||
import { ExceptionService, SpinnerService, ToastService } from '../../core';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import { Http } from '@angular/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Hero } from './hero.model';
|
||||
// #enddocregion example
|
||||
|
@ -20,12 +20,12 @@ export class HeroService {
|
|||
|
||||
getHero(id: number) {
|
||||
return this.http.get(`api/heroes/${id}`)
|
||||
.map((res: Response) => res.json().data);
|
||||
.map(response => response.json().data as Hero);
|
||||
}
|
||||
|
||||
getHeroes() {
|
||||
return this.http.get(`api/heroes`)
|
||||
.map((res: Response) => res.json().data);
|
||||
.map(response => response.json().data as Hero[]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// #docregion
|
||||
// #docregion example
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import { Http } from '@angular/http';
|
||||
|
||||
import { Hero } from './hero.model';
|
||||
import { ExceptionService, SpinnerService, ToastService } from '../../core';
|
||||
|
@ -20,12 +20,12 @@ export class HeroService {
|
|||
|
||||
getHero(id: number) {
|
||||
return this.http.get(`api/heroes/${id}`)
|
||||
.map((res: Response) => res.json().data);
|
||||
.map(response => response.json().data as Hero);
|
||||
}
|
||||
|
||||
getHeroes() {
|
||||
return this.http.get(`api/heroes`)
|
||||
.map((res: Response) => res.json().data);
|
||||
.map(response => response.json().data as Hero[]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
// #enddocregion example
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { RouterModule } from '@angular/router';
|
||||
// #docregion example
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { AppComponent } from './app.component';
|
||||
import { HeroesComponent } from './heroes/heroes.component';
|
||||
|
||||
@NgModule({
|
||||
|
|
|
@ -1,21 +1,12 @@
|
|||
// #docplaster
|
||||
// #docregion
|
||||
// #docregion example
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
// #enddocregion example
|
||||
moduleId: module.id,
|
||||
// #docregion example
|
||||
selector: 'toh-heroes',
|
||||
templateUrl: 'heroes.component.html'
|
||||
templateUrl: './heroes.component.html'
|
||||
})
|
||||
export class HeroesComponent implements OnInit {
|
||||
// #enddocregion example
|
||||
// #docregion example
|
||||
constructor() { }
|
||||
constructor() { /* ... */ }
|
||||
|
||||
ngOnInit() { }
|
||||
ngOnInit() { /* ... */ }
|
||||
}
|
||||
// #enddocregion example
|
||||
|
||||
|
|
|
@ -1,23 +1,14 @@
|
|||
// #docplaster
|
||||
// #docregion
|
||||
// #docregion example
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
import { FilterTextService } from '../shared/filter-text/filter-text.service';
|
||||
|
||||
@Component({
|
||||
// #enddocregion example
|
||||
moduleId: module.id,
|
||||
// #docregion example
|
||||
selector: 'toh-heroes',
|
||||
templateUrl: 'heroes.component.html'
|
||||
templateUrl: './heroes.component.html'
|
||||
})
|
||||
export class HeroesComponent implements OnInit {
|
||||
// #enddocregion example
|
||||
// #docregion example
|
||||
filteredHeroes: any[] = [];
|
||||
|
||||
constructor(private filterService: FilterTextService) { }
|
||||
export class HeroesComponent {
|
||||
|
||||
heroes = [
|
||||
{ id: 1, name: 'Windstorm' },
|
||||
|
@ -26,13 +17,12 @@ export class HeroesComponent implements OnInit {
|
|||
{ id: 4, name: 'Tornado' }
|
||||
];
|
||||
|
||||
filteredHeroes = this.heroes;
|
||||
|
||||
constructor(private filterService: FilterTextService) { }
|
||||
|
||||
filterChanged(searchText: string) {
|
||||
this.filteredHeroes = this.filterService.filter(searchText, ['id', 'name'], this.heroes);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.filteredHeroes = this.heroes;
|
||||
}
|
||||
}
|
||||
// #enddocregion example
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ import { Component, OnInit } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'toh-nav',
|
||||
templateUrl: 'nav.component.html',
|
||||
styleUrls: ['nav.component.css'],
|
||||
templateUrl: './nav.component.html',
|
||||
styleUrls: ['./nav.component.css'],
|
||||
})
|
||||
export class NavComponent implements OnInit {
|
||||
menuItems = [
|
||||
|
|
|
@ -8,8 +8,8 @@ import { SpinnerState, SpinnerService } from './spinner.service';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'toh-spinner',
|
||||
templateUrl: 'spinner.component.html',
|
||||
styleUrls: ['spinner.component.css']
|
||||
templateUrl: './spinner.component.html',
|
||||
styleUrls: ['./spinner.component.css']
|
||||
})
|
||||
export class SpinnerComponent implements OnDestroy, OnInit {
|
||||
visible = false;
|
||||
|
|
|
@ -1,21 +1,14 @@
|
|||
// #docplaster
|
||||
// #docregion
|
||||
// #docregion example
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
import { LoggerService } from '../core/logger.service';
|
||||
import { LoggerService } from '../core/logger.service';
|
||||
import { SpinnerService } from '../core/spinner/spinner.service';
|
||||
|
||||
@Component({
|
||||
// #enddocregion example
|
||||
moduleId: module.id,
|
||||
// #docregion example
|
||||
selector: 'toh-heroes',
|
||||
templateUrl: 'heroes.component.html'
|
||||
templateUrl: './heroes.component.html'
|
||||
})
|
||||
export class HeroesComponent {
|
||||
// #enddocregion example
|
||||
// #docregion example
|
||||
heroes: any[];
|
||||
|
||||
constructor(
|
||||
|
@ -38,4 +31,3 @@ export class HeroesComponent {
|
|||
}, 2000);
|
||||
}
|
||||
}
|
||||
// #enddocregion example
|
||||
|
|
|
@ -4,8 +4,8 @@ import { Component, OnInit } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'toh-nav',
|
||||
templateUrl: 'nav.component.html',
|
||||
styleUrls: ['nav.component.css'],
|
||||
templateUrl: './nav.component.html',
|
||||
styleUrls: ['./nav.component.css'],
|
||||
})
|
||||
export class NavComponent implements OnInit {
|
||||
menuItems = [
|
||||
|
|
|
@ -1,20 +1,13 @@
|
|||
// #docplaster
|
||||
// #docregion
|
||||
// #docregion example
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
import { LoggerService } from '../core/logger.service';
|
||||
|
||||
@Component({
|
||||
// #enddocregion example
|
||||
moduleId: module.id,
|
||||
// #docregion example
|
||||
selector: 'toh-heroes',
|
||||
templateUrl: 'heroes.component.html'
|
||||
templateUrl: './heroes.component.html'
|
||||
})
|
||||
export class HeroesComponent {
|
||||
// #enddocregion example
|
||||
// #docregion example
|
||||
heroes: any[];
|
||||
|
||||
constructor(private loggerService: LoggerService) { }
|
||||
|
@ -30,4 +23,3 @@ export class HeroesComponent {
|
|||
this.loggerService.log(`We have ${HeroesComponent.length} heroes`);
|
||||
}
|
||||
}
|
||||
// #enddocregion example
|
||||
|
|
|
@ -3,6 +3,6 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'sg-app',
|
||||
templateUrl: 'app.component.html'
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
export class AppComponent { }
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
// #docplaster
|
||||
// #docregion
|
||||
import { Component } from '@angular/core';
|
||||
// #docregion example
|
||||
/* avoid */
|
||||
|
||||
@Component({
|
||||
// #enddocregion example
|
||||
moduleId: module.id,
|
||||
// #docregion example
|
||||
selector: 'tohHeroButton',
|
||||
templateUrl: 'hero-button.component.html'
|
||||
templateUrl: './hero-button.component.html'
|
||||
})
|
||||
export class HeroButtonComponent {}
|
||||
// #enddocregion example
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
// #docplaster
|
||||
// #docregion
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
// #docregion example
|
||||
@Component({
|
||||
// #enddocregion example
|
||||
moduleId: module.id,
|
||||
// #docregion example
|
||||
selector: 'toh-hero-button',
|
||||
templateUrl: 'hero-button.component.html'
|
||||
templateUrl: './hero-button.component.html'
|
||||
})
|
||||
export class HeroButtonComponent {}
|
||||
// #enddocregion example
|
||||
|
|
|
@ -3,6 +3,6 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'sg-app',
|
||||
templateUrl: 'app.component.html'
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
export class AppComponent { }
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
// #docplaster
|
||||
// #docregion
|
||||
import { Component } from '@angular/core';
|
||||
// #docregion example
|
||||
/* avoid */
|
||||
|
||||
@Component({
|
||||
// #enddocregion example
|
||||
moduleId: module.id,
|
||||
// #docregion example
|
||||
selector: '[tohHeroButton]',
|
||||
templateUrl: 'hero-button.component.html'
|
||||
templateUrl: './hero-button.component.html'
|
||||
})
|
||||
export class HeroButtonComponent {}
|
||||
// #enddocregion example
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
// #docplaster
|
||||
// #docregion
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
// #docregion example
|
||||
@Component({
|
||||
// #enddocregion example
|
||||
moduleId: module.id,
|
||||
// #docregion example
|
||||
selector: 'toh-hero-button',
|
||||
templateUrl: 'hero-button.component.html'
|
||||
templateUrl: './hero-button.component.html'
|
||||
})
|
||||
export class HeroButtonComponent {}
|
||||
// #enddocregion example
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { NgModule } from '@angular/core';
|
||||
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 { HeroService } from './heroes/shared';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -14,6 +15,7 @@ import { HeroesComponent } from './heroes';
|
|||
AppComponent,
|
||||
HeroesComponent
|
||||
],
|
||||
exports: [ AppComponent ]
|
||||
exports: [ AppComponent ],
|
||||
providers: [ HeroService ]
|
||||
})
|
||||
export class AppModule {}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
// #docregion
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
import { Hero, HeroService } from './shared';
|
||||
|
||||
import { Hero } from './shared/hero.model';
|
||||
// #docregion example
|
||||
/* avoid */
|
||||
|
||||
|
@ -11,7 +12,7 @@ import { Hero } from './shared/hero.model';
|
|||
<div>
|
||||
<h2>My Heroes</h2>
|
||||
<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}}
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -51,9 +52,13 @@ import { Hero } from './shared/hero.model';
|
|||
`]
|
||||
})
|
||||
export class HeroesComponent implements OnInit {
|
||||
heroes: Hero[];
|
||||
heroes: Observable<Hero[]>;
|
||||
selectedHero: Hero;
|
||||
|
||||
ngOnInit() {}
|
||||
constructor(private heroService: HeroService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.heroes = this.heroService.getHeroes();
|
||||
}
|
||||
}
|
||||
// #enddocregion example
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div>
|
||||
<h2>My Heroes</h2>
|
||||
<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}}
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -1,22 +1,23 @@
|
|||
// #docplaster
|
||||
// #docregion
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
import { Hero } from './shared';
|
||||
import { Hero, HeroService } from './shared';
|
||||
|
||||
// #docregion example
|
||||
@Component({
|
||||
// #enddocregion example
|
||||
moduleId: module.id,
|
||||
// #docregion example
|
||||
selector: 'toh-heroes',
|
||||
templateUrl: 'heroes.component.html',
|
||||
styleUrls: ['heroes.component.css']
|
||||
templateUrl: './heroes.component.html',
|
||||
styleUrls: ['./heroes.component.css']
|
||||
})
|
||||
export class HeroesComponent implements OnInit {
|
||||
heroes: Hero[];
|
||||
heroes: Observable<Hero[]>;
|
||||
selectedHero: Hero;
|
||||
|
||||
ngOnInit() { }
|
||||
constructor(private heroService: HeroService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.heroes = this.heroService.getHeroes();
|
||||
}
|
||||
}
|
||||
// #enddocregion example
|
||||
|
|
|
@ -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[]);
|
||||
}
|
||||
}
|
|
@ -1 +1,2 @@
|
|||
export * from './hero.model';
|
||||
export * from './hero.service';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
<!-- #docregion -->
|
||||
<toh-hero-button label="OK" (change)="doSomething()">
|
||||
</toh-hero-button>
|
||||
|
||||
<!-- `heroHighlight` is both the directive name and the data-bound aliased property name -->
|
||||
<h3 heroHighlight="skyblue">The Great Bombasto</h3>
|
||||
|
|
|
@ -3,6 +3,6 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'sg-app',
|
||||
templateUrl: 'app.component.html'
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
export class AppComponent { }
|
||||
|
|
|
@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
|
|||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { HeroButtonComponent } from './heroes';
|
||||
import { HeroButtonComponent, HeroHighlightDirective } from './heroes';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -10,7 +10,7 @@ import { HeroButtonComponent } from './heroes';
|
|||
],
|
||||
declarations: [
|
||||
AppComponent,
|
||||
HeroButtonComponent
|
||||
HeroButtonComponent, HeroHighlightDirective
|
||||
],
|
||||
exports: [ AppComponent ]
|
||||
})
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
// #docregion
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
// #docregion example
|
||||
/* avoid */
|
||||
/* avoid pointless aliasing */
|
||||
|
||||
@Component({
|
||||
selector: 'toh-hero-button',
|
||||
template: `<button>{{label}}</button>`
|
||||
})
|
||||
export class HeroButtonComponent {
|
||||
// Pointless aliases
|
||||
@Output('changeEvent') change = new EventEmitter<any>();
|
||||
@Input('labelAttribute') label: string;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|||
template: `<button>{{label}}</button>`
|
||||
})
|
||||
export class HeroButtonComponent {
|
||||
// No aliases
|
||||
@Output() change = new EventEmitter<any>();
|
||||
@Input() label: string;
|
||||
}
|
||||
|
|
|
@ -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';
|
||||
}
|
||||
}
|
|
@ -1 +1,2 @@
|
|||
export * from './hero-button';
|
||||
export * from './hero-highlight.directive';
|
||||
|
|
|
@ -3,6 +3,6 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'sg-app',
|
||||
templateUrl: 'app.component.html'
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
export class AppComponent { }
|
||||
|
|
|
@ -3,6 +3,6 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'sg-app',
|
||||
templateUrl: 'app.component.html'
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
export class AppComponent { }
|
||||
|
|
|
@ -5,7 +5,7 @@ import { Hero, HeroService } from './heroes';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'sg-app',
|
||||
templateUrl: 'app.component.html',
|
||||
templateUrl: './app.component.html',
|
||||
providers: [HeroService]
|
||||
})
|
||||
export class AppComponent implements OnInit {
|
||||
|
|
|
@ -3,6 +3,6 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: 'app.component.html'
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
export class AppComponent { }
|
||||
|
|
|
@ -19,7 +19,7 @@ export enum Color {Red, Green, Blue};
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: 'app.component.html'
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
export class AppComponent implements AfterViewInit, OnInit {
|
||||
|
||||
|
|
|
@ -3,6 +3,6 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'my-app',
|
||||
templateUrl: 'app.component.html'
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
export class AppComponent { }
|
||||
|
|
|
@ -251,7 +251,7 @@ export class TestViewProvidersComponent {
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'external-template-comp',
|
||||
templateUrl: 'bag-external-template.html'
|
||||
templateUrl: './bag-external-template.html'
|
||||
})
|
||||
export class ExternalTemplateComponent implements OnInit {
|
||||
serviceValue: string;
|
||||
|
@ -275,7 +275,7 @@ export class InnerCompWithExternalTemplateComponent { }
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'bad-template-comp',
|
||||
templateUrl: 'non-existant.html'
|
||||
templateUrl: './non-existant.html'
|
||||
})
|
||||
export class BadTemplateUrlComponent { }
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-banner',
|
||||
templateUrl: 'banner.component.html',
|
||||
styleUrls: ['banner.component.css']
|
||||
templateUrl: './banner.component.html',
|
||||
styleUrls: ['./banner.component.css']
|
||||
})
|
||||
export class BannerComponent {
|
||||
title = 'Test Tour of Heroes';
|
||||
|
|
|
@ -7,8 +7,8 @@ import { Hero } from '../model';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'dashboard-hero',
|
||||
templateUrl: 'dashboard-hero.component.html',
|
||||
styleUrls: [ 'dashboard-hero.component.css' ]
|
||||
templateUrl: './dashboard-hero.component.html',
|
||||
styleUrls: [ './dashboard-hero.component.css' ]
|
||||
})
|
||||
export class DashboardHeroComponent {
|
||||
@Input() hero: Hero;
|
||||
|
|
|
@ -7,8 +7,8 @@ import { Hero, HeroService } from '../model';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-dashboard',
|
||||
templateUrl: 'dashboard.component.html',
|
||||
styleUrls: [ 'dashboard.component.css' ]
|
||||
templateUrl: './dashboard.component.html',
|
||||
styleUrls: [ './dashboard.component.css' ]
|
||||
})
|
||||
export class DashboardComponent implements OnInit {
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ import { HeroDetailService } from './hero-detail.service';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-hero-detail',
|
||||
templateUrl: 'hero-detail.component.html',
|
||||
styleUrls: ['hero-detail.component.css' ],
|
||||
templateUrl: './hero-detail.component.html',
|
||||
styleUrls: ['./hero-detail.component.css' ],
|
||||
providers: [ HeroDetailService ]
|
||||
})
|
||||
export class HeroDetailComponent implements OnInit {
|
||||
|
|
|
@ -6,8 +6,8 @@ import { Hero, HeroService } from '../model';
|
|||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'app-heroes',
|
||||
templateUrl: 'hero-list.component.html',
|
||||
styleUrls: [ 'hero-list.component.css' ]
|
||||
templateUrl: './hero-list.component.html',
|
||||
styleUrls: [ './hero-list.component.css' ]
|
||||
})
|
||||
export class HeroListComponent implements OnInit {
|
||||
heroes: Promise<Hero[]>;
|
||||
|
|
|
@ -15,7 +15,7 @@ import { Component } from '@angular/core';
|
|||
`,
|
||||
// #enddocregion template
|
||||
// #docregion styleUrls
|
||||
styleUrls: ['app.component.css'],
|
||||
styleUrls: ['./app.component.css'],
|
||||
// #enddocregion styleUrls
|
||||
})
|
||||
export class AppComponent {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue