chore: convert relative templateUrl/styleUrls to have ./

This commit is contained in:
Filipe Silva 2017-01-04 18:56:49 +00:00
parent 2f28b321ee
commit 4ec1736f18
100 changed files with 126 additions and 125 deletions

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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,

View File

@ -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

View File

@ -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;

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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;

View File

@ -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

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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

View File

@ -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;

View File

@ -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 { }

View File

@ -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

View File

@ -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

View File

@ -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>;

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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;

View File

@ -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;}',

View File

@ -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 = '';

View File

@ -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 {

View File

@ -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;}',

View File

@ -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'

View File

@ -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

View File

@ -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;}',

View File

@ -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 = '';

View File

@ -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 {

View File

@ -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

View File

@ -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 { }

View File

@ -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 {

View File

@ -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 {

View File

@ -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 { }

View File

@ -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 {

View File

@ -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 {

View File

@ -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}'

View File

@ -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;

View File

@ -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;

View File

@ -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 = '';

View File

@ -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 = '';

View File

@ -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

View File

@ -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

View File

@ -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 ]
})

View File

@ -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;

View File

@ -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 {

View File

@ -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;}']
})

View File

@ -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;}']
})

View File

@ -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 {

View File

@ -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 {

View File

@ -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 { }

View File

@ -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 {

View File

@ -8,7 +8,7 @@ import { Component, OnInit } from '@angular/core';
moduleId: module.id,
// #docregion example
selector: 'toh-heroes',
templateUrl: 'heroes.component.html'
templateUrl: './heroes.component.html'
})
export class HeroesComponent implements OnInit {
// #enddocregion example

View File

@ -10,7 +10,7 @@ import { FilterTextService } from '../shared/filter-text/filter-text.service';
moduleId: module.id,
// #docregion example
selector: 'toh-heroes',
templateUrl: 'heroes.component.html'
templateUrl: './heroes.component.html'
})
export class HeroesComponent implements OnInit {
// #enddocregion example

View File

@ -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 = [

View File

@ -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;

View File

@ -11,7 +11,7 @@ import { SpinnerService } from '../core/spinner/spinner.service';
moduleId: module.id,
// #docregion example
selector: 'toh-heroes',
templateUrl: 'heroes.component.html'
templateUrl: './heroes.component.html'
})
export class HeroesComponent {
// #enddocregion example

View File

@ -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 = [

View File

@ -10,7 +10,7 @@ import { LoggerService } from '../core/logger.service';
moduleId: module.id,
// #docregion example
selector: 'toh-heroes',
templateUrl: 'heroes.component.html'
templateUrl: './heroes.component.html'
})
export class HeroesComponent {
// #enddocregion example

View File

@ -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 { }

View File

@ -9,7 +9,7 @@ import { Component } from '@angular/core';
moduleId: module.id,
// #docregion example
selector: 'tohHeroButton',
templateUrl: 'hero-button.component.html'
templateUrl: './hero-button.component.html'
})
export class HeroButtonComponent {}
// #enddocregion example

View File

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

View File

@ -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 { }

View File

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

View File

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

View File

@ -10,8 +10,8 @@ import { Hero } from './shared';
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[];

View File

@ -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 { }

View File

@ -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 { }

View File

@ -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 { }

View File

@ -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 {

View File

@ -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 { }

View File

@ -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 {

View File

@ -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 { }

View File

@ -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 { }

View File

@ -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';

View File

@ -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;

View File

@ -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 {

View File

@ -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 {

View File

@ -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[]>;

View File

@ -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 {

View File

@ -10,10 +10,10 @@ import { HeroService } from './hero.service';
@Component({
moduleId: module.id,
selector: 'my-dashboard',
templateUrl: 'dashboard.component.html',
templateUrl: './dashboard.component.html',
// #enddocregion metadata
// #docregion css
styleUrls: [ 'dashboard.component.css' ]
styleUrls: [ './dashboard.component.css' ]
// #enddocregion css
// #docregion metadata
})

View File

@ -12,9 +12,9 @@ import { HeroService } from './hero.service';
@Component({
moduleId: module.id,
selector: 'my-hero-detail',
templateUrl: 'hero-detail.component.html',
templateUrl: './hero-detail.component.html',
// #enddocregion metadata, v2
styleUrls: [ 'hero-detail.component.css' ]
styleUrls: [ './hero-detail.component.css' ]
// #docregion metadata, v2
})
// #enddocregion metadata

View File

@ -13,8 +13,8 @@ import { HeroService } from './hero.service';
// #docregion renaming
selector: 'my-heroes',
// #enddocregion renaming
templateUrl: 'heroes.component.html',
styleUrls: [ 'heroes.component.css' ]
templateUrl: './heroes.component.html',
styleUrls: [ './heroes.component.css' ]
// #docregion renaming
})
// #enddocregion metadata

View File

@ -13,7 +13,7 @@ import { Component } from '@angular/core';
</nav>
<router-outlet></router-outlet>
`,
styleUrls: ['app.component.css']
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Tour of Heroes';

View File

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

View File

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

View File

@ -11,8 +11,8 @@ import { Hero } from './hero';
@Component({
moduleId: module.id,
selector: 'hero-search',
templateUrl: 'hero-search.component.html',
styleUrls: [ 'hero-search.component.css' ],
templateUrl: './hero-search.component.html',
styleUrls: [ './hero-search.component.css' ],
providers: [HeroSearchService]
})
export class HeroSearchComponent implements OnInit {

View File

@ -8,8 +8,8 @@ import { HeroService } from './hero.service';
@Component({
moduleId: module.id,
selector: 'my-heroes',
templateUrl: 'heroes.component.html',
styleUrls: [ 'heroes.component.css' ]
templateUrl: './heroes.component.html',
styleUrls: [ './heroes.component.css' ]
})
export class HeroesComponent implements OnInit {
heroes: Hero[];

View File

@ -14,7 +14,7 @@ import { Phone, PhoneData } from '../core/phone/phone.service';
@Component({
moduleId: module.id,
selector: 'phone-detail',
templateUrl: 'phone-detail.template.html',
templateUrl: './phone-detail.template.html',
// #enddocregion initialclass
// #docregion initialclass
})

View File

@ -8,7 +8,7 @@ import { Phone, PhoneData } from '../core/phone/phone.service';
@Component({
moduleId: module.id,
selector: 'phone-detail',
templateUrl: 'phone-detail.template.html'
templateUrl: './phone-detail.template.html'
})
export class PhoneDetailComponent {
phone: PhoneData;

View File

@ -7,7 +7,7 @@ import { Phone, PhoneData } from '../core/phone/phone.service';
@Component({
moduleId: module.id,
selector: 'phone-list',
templateUrl: 'phone-list.template.html',
templateUrl: './phone-list.template.html',
})
// #enddocregion top
export class PhoneListComponent {

View File

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

View File

@ -64,7 +64,8 @@ include ../_util-fns
relative to the component class file simply by setting the `moduleId` property of the `@Component` metadata like this
+makeExample('cb-component-relative-paths/ts/app/some.component.ts','module-id')(format='.')
:marked
We strip the `app/` base path from the `templateUrl` and `styleUrls`. The result looks like this:
We strip the `app/` base path from the `templateUrl` and `styleUrls` and replace it with `./`.
The result looks like this:
+makeExample('cb-component-relative-paths/ts/app/some.component.ts','relative-config')(format='.')
.alert.is-helpful

View File

@ -249,7 +249,7 @@ a#class-metadata
`)(format='.')
:marked
Note that the _TypeScript_ and both _ES6_ `templateUrl` properties identify the location of the template file _relative to the component module_.
Note that both the _TypeScript_ and _ES6_ `templateUrl` properties identify the location of the template file _relative to the component module_.
All three metadata configurations specify the `moduleId` property
so that Angular can calculate the proper module address.