diff --git a/public/docs/_examples/architecture/ts/app/hero-list.component.ts b/public/docs/_examples/architecture/ts/app/hero-list.component.ts index 8e4ca9b1ae..d7bc9e75d9 100644 --- a/public/docs/_examples/architecture/ts/app/hero-list.component.ts +++ b/public/docs/_examples/architecture/ts/app/hero-list.component.ts @@ -24,13 +24,13 @@ export class HeroesComponent { ... } */ // #docregion class export class HeroListComponent implements OnInit { + heroes: Hero[]; + selectedHero: Hero; + // #docregion ctor constructor(private service: HeroService) { } // #enddocregion ctor - heroes: Hero[]; - selectedHero: Hero; - ngOnInit() { this.heroes = this.service.getHeroes(); } diff --git a/public/docs/_examples/architecture/ts/app/hero.service.ts b/public/docs/_examples/architecture/ts/app/hero.service.ts index d5df3bdf31..027d4bfc6a 100644 --- a/public/docs/_examples/architecture/ts/app/hero.service.ts +++ b/public/docs/_examples/architecture/ts/app/hero.service.ts @@ -7,14 +7,14 @@ import { Logger } from './logger.service'; @Injectable() // #docregion class export class HeroService { + private heroes: Hero[] = []; + // #docregion ctor constructor( private backend: BackendService, private logger: Logger) { } // #enddocregion ctor - private heroes: Hero[] = []; - getHeroes() { this.backend.getAll(Hero).then( (heroes: Hero[]) => { this.logger.log(`Fetched ${heroes.length} heroes.`); diff --git a/public/docs/_examples/architecture/ts/app/sales-tax.service.ts b/public/docs/_examples/architecture/ts/app/sales-tax.service.ts index f0d5457342..5bf505548a 100644 --- a/public/docs/_examples/architecture/ts/app/sales-tax.service.ts +++ b/public/docs/_examples/architecture/ts/app/sales-tax.service.ts @@ -1,5 +1,5 @@ // #docregion -import { Inject, Injectable } from '@angular/core'; +import { Injectable } from '@angular/core'; import { TaxRateService } from './tax-rate.service'; diff --git a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.1.ts b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.1.ts index f8c1a95ea1..4cacc0d22e 100644 --- a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.1.ts +++ b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.1.ts @@ -1,3 +1,4 @@ +/* tslint:disable:no-unused-variable */ // #docregion import { Directive, ElementRef, Input } from '@angular/core'; diff --git a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts index d6b295fae2..3baf3449fb 100644 --- a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts +++ b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts @@ -1,14 +1,10 @@ +/* tslint:disable:no-unused-variable */ +// #docplaster // #docregion -import { Directive, ElementRef, Input } from '@angular/core'; +import { Directive, ElementRef, HostListener, Input } from '@angular/core'; @Directive({ - selector: '[myHighlight]', - // #docregion host - host: { - '(mouseenter)': 'onMouseEnter()', - '(mouseleave)': 'onMouseLeave()' - } - // #enddocregion host + selector: '[myHighlight]' }) export class HighlightDirective { @@ -18,9 +14,19 @@ export class HighlightDirective { constructor(el: ElementRef) { this.el = el.nativeElement; } // #enddocregion ctor - // #docregion mouse-methods - onMouseEnter() { this.highlight('yellow'); } - onMouseLeave() { this.highlight(null); } + // #docregion mouse-methods, host + @HostListener('mouseenter') onMouseEnter() { + // #enddocregion host + this.highlight('yellow'); + // #docregion host + } + + @HostListener('mouseleave') onMouseLeave() { + // #enddocregion host + this.highlight(null); + // #docregion host + } + // #enddocregion host private highlight(color: string) { this.el.style.backgroundColor = color; diff --git a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts index 09a762a892..cd6c7870a1 100644 --- a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts +++ b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts @@ -1,13 +1,9 @@ // #docplaster // #docregion full -import { Directive, ElementRef, Input } from '@angular/core'; +import { Directive, ElementRef, HostListener, Input } from '@angular/core'; @Directive({ - selector: '[myHighlight]', - host: { - '(mouseenter)': 'onMouseEnter()', - '(mouseleave)': 'onMouseLeave()' - } + selector: '[myHighlight]' }) // #docregion class-1 export class HighlightDirective { @@ -29,9 +25,13 @@ export class HighlightDirective { // #enddocregion color // #docregion mouse-enter - onMouseEnter() { this.highlight(this.highlightColor || this._defaultColor); } + @HostListener('mouseenter') onMouseEnter() { + this.highlight(this.highlightColor || this._defaultColor); + } // #enddocregion mouse-enter - onMouseLeave() { this.highlight(null); } + @HostListener('mouseleave') onMouseLeave() { + this.highlight(null); + } private highlight(color: string) { this.el.style.backgroundColor = color; diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/date.pipe.ts b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/date.pipe.ts index c04e64247d..e1421fa530 100644 --- a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/date.pipe.ts +++ b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/date.pipe.ts @@ -1,10 +1,10 @@ -import { Injectable, Pipe } from '@angular/core'; +import { Injectable, Pipe, PipeTransform } from '@angular/core'; import { DatePipe } from '@angular/common'; @Injectable() // #docregion date-pipe @Pipe({name: 'date', pure: true}) -export class StringSafeDatePipe extends DatePipe { +export class StringSafeDatePipe extends DatePipe implements PipeTransform { transform(value: any, format: string): string { value = typeof value === 'string' ? Date.parse(value) : value; diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.ts b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.ts index 286615b95c..4157d8aa3a 100644 --- a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.ts +++ b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.ts @@ -1,3 +1,4 @@ +/* tslint:disable:no-unused-variable */ // #docplaster // #docregion import import { Component } from '@angular/core'; diff --git a/public/docs/_examples/cb-component-communication/ts/app/app.component.ts b/public/docs/_examples/cb-component-communication/ts/app/app.component.ts index 332d8f7f0f..891b5c86ac 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/app.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/app.component.ts @@ -25,7 +25,7 @@ if (!/e2e/.test(location.search)) { } @Component({ - selector: 'app', + selector: 'my-app', templateUrl: 'app/app.component.html', directives: directives }) diff --git a/public/docs/_examples/cb-component-communication/ts/index.html b/public/docs/_examples/cb-component-communication/ts/index.html index 51adcdaf23..4afa076c19 100644 --- a/public/docs/_examples/cb-component-communication/ts/index.html +++ b/public/docs/_examples/cb-component-communication/ts/index.html @@ -23,7 +23,7 @@ - loading... + loading... diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero-bio.component.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero-bio.component.ts index d1e44ae1b2..84f8e05e66 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero-bio.component.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero-bio.component.ts @@ -1,7 +1,6 @@ // #docregion import { Component, Input, OnInit } from '@angular/core'; -import { Hero } from './hero'; import { HeroCacheService } from './hero-cache.service'; // #docregion component @@ -17,7 +16,6 @@ import { HeroCacheService } from './hero-cache.service'; }) export class HeroBioComponent implements OnInit { - @Input() heroId: number; constructor(private heroCache: HeroCacheService) { } diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero-bios.component.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero-bios.component.ts index 5ce00bba1a..8b738bf04f 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero-bios.component.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero-bios.component.ts @@ -1,6 +1,6 @@ // #docplaster // #docregion -import { Component} from '@angular/core'; +import { Component } from '@angular/core'; import { HeroContactComponent } from './hero-contact.component'; import { HeroBioComponent } from './hero-bio.component'; diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero-contact.component.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero-contact.component.ts index a2cd8ec75f..add6df91c5 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero-contact.component.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero-contact.component.ts @@ -1,6 +1,6 @@ // #docplaster // #docregion -import { Component, ElementRef, Host, Inject, Optional } from '@angular/core'; +import { Component, Host, Optional } from '@angular/core'; import { HeroCacheService } from './hero-cache.service'; import { LoggerService } from './logger.service'; diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/highlight.directive.ts b/public/docs/_examples/cb-dependency-injection/ts/app/highlight.directive.ts index 69bd1a1577..e220114daa 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/highlight.directive.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/highlight.directive.ts @@ -1,13 +1,9 @@ // #docplaster // #docregion -import { Directive, ElementRef, Input } from '@angular/core'; +import { Directive, ElementRef, HostListener, Input } from '@angular/core'; @Directive({ - selector: '[myHighlight]', - host: { - '(mouseenter)': 'onMouseEnter()', - '(mouseleave)': 'onMouseLeave()' - } + selector: '[myHighlight]' }) export class HighlightDirective { @@ -19,8 +15,13 @@ export class HighlightDirective { this.el = el.nativeElement; } - onMouseEnter() { this.highlight(this.highlightColor || 'cyan'); } - onMouseLeave() { this.highlight(null); } + @HostListener('mouseenter') onMouseEnter() { + this.highlight(this.highlightColor || 'cyan'); + } + + @HostListener('mouseleave') onMouseLeave() { + this.highlight(null); + } private highlight(color: string) { this.el.style.backgroundColor = color; diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/parent-finder.component.ts b/public/docs/_examples/cb-dependency-injection/ts/app/parent-finder.component.ts index 8d0d8cc466..a8e245376c 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/parent-finder.component.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/parent-finder.component.ts @@ -1,5 +1,5 @@ -/* tslint:disable:no-unused-variable */ -/* tslint:disable:one-line:check-open-brace*/ +/* tslint:disable:no-unused-variable component-selector-name one-line check-open-brace */ +/* tslint:disable:*/ // #docplaster // #docregion import { Component, forwardRef, Optional, provide, SkipSelf } from '@angular/core'; @@ -23,7 +23,7 @@ const provideParent = // #enddocregion provide-parent, provide-the-parent // #docregion provide-parent (component: any, parentType?: any) => { - return { provide: parentType || Parent, useExisting: forwardRef(() => component) }; + return { provide: parentType || Parent, useExisting: forwardRef(() => component) }; }; // #enddocregion provide-parent diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/app.component.ts b/public/docs/_examples/cb-dynamic-form/ts/app/app.component.ts index 74a4909de3..e51561770e 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/app.component.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/app.component.ts @@ -1,7 +1,7 @@ // #docregion import { Component } from '@angular/core'; -import { DynamicForm } from './dynamic-form.component'; +import { DynamicFormComponent } from './dynamic-form.component'; import { QuestionService } from './question.service'; @Component({ @@ -12,7 +12,7 @@ import { QuestionService } from './question.service'; `, - directives: [DynamicForm], + directives: [DynamicFormComponent], providers: [QuestionService] }) export class AppComponent { diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form.component.ts b/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form.component.ts index a6374871ab..5d6eb833ed 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form.component.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form.component.ts @@ -12,7 +12,7 @@ import { DynamicFormQuestionComponent } from './dynamic-form-question.component' directives: [DynamicFormQuestionComponent], providers: [QuestionControlService] }) -export class DynamicForm { +export class DynamicFormComponent implements OnInit { @Input() questions: QuestionBase[] = []; form: ControlGroup; diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/question-control.service.ts b/public/docs/_examples/cb-dynamic-form/ts/app/question-control.service.ts index fb86366c51..3d56b0c2f6 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/question-control.service.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/question-control.service.ts @@ -1,6 +1,6 @@ // #docregion import { Injectable } from '@angular/core'; -import { ControlGroup, FormBuilder, Validators } from '@angular/common'; +import { FormBuilder, Validators } from '@angular/common'; import { QuestionBase } from './question-base'; @Injectable() diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/question.service.ts b/public/docs/_examples/cb-dynamic-form/ts/app/question.service.ts index 7ba417ee3c..ee169d0827 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/question.service.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/question.service.ts @@ -2,7 +2,6 @@ import { Injectable } from '@angular/core'; import { QuestionBase } from './question-base'; -import { DynamicForm } from './dynamic-form.component'; import { TextboxQuestion } from './question-textbox'; import { DropdownQuestion } from './question-dropdown'; diff --git a/public/docs/_examples/cb-ts-to-js/e2e-spec.ts b/public/docs/_examples/cb-ts-to-js/e2e-spec.ts index dbb308fbf7..f5071cb9b1 100644 --- a/public/docs/_examples/cb-ts-to-js/e2e-spec.ts +++ b/public/docs/_examples/cb-ts-to-js/e2e-spec.ts @@ -59,7 +59,7 @@ describe('TypeScript to Javascript tests', function () { it('should support content and view queries', function() { let app = element(by.css('heroes-queries')); - let windstorm = app.element(by.css('hero:first-child')); + let windstorm = app.element(by.css('a-hero:first-child')); app.element(by.buttonText('Activate')).click(); expect(windstorm.element(by.css('h2')).getAttribute('class')).toBe('active'); diff --git a/public/docs/_examples/cb-ts-to-js/js/app/heroes-queries.component.js b/public/docs/_examples/cb-ts-to-js/js/app/heroes-queries.component.js index cd49a01754..17cb57093f 100644 --- a/public/docs/_examples/cb-ts-to-js/js/app/heroes-queries.component.js +++ b/public/docs/_examples/cb-ts-to-js/js/app/heroes-queries.component.js @@ -15,7 +15,7 @@ // #docregion content var HeroComponent = ng.core.Component({ - selector: 'hero', + selector: 'a-hero', template: '

' + '{{hero.name}} ' + '' + @@ -38,10 +38,10 @@ var AppComponent = ng.core.Component({ selector: 'heroes-queries', template: - '' + '' + - '' + + '' + '', diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/heroes-queries.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/heroes-queries.component.ts index be8176e951..b511f29f90 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/heroes-queries.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/heroes-queries.component.ts @@ -23,7 +23,7 @@ class ActiveLabelComponent { // #docregion content @Component({ - selector: 'hero', + selector: 'a-hero', template: `

{{hero.name}} @@ -48,10 +48,10 @@ class HeroComponent { @Component({ selector: 'heroes-queries', template: ` - - + diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/main.ts b/public/docs/_examples/cb-ts-to-js/ts/app/main.ts index 340b0b9a0d..9e1540abc2 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/main.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/main.ts @@ -1,3 +1,4 @@ +/* tslint:disable no-unused-variable */ // #docregion ng2import import { bootstrap } from '@angular/platform-browser-dynamic'; diff --git a/public/docs/_examples/cli-quickstart/e2e-spec.ts b/public/docs/_examples/cli-quickstart/e2e-spec.ts index 4134ed74a1..7d5b5bf98b 100644 --- a/public/docs/_examples/cli-quickstart/e2e-spec.ts +++ b/public/docs/_examples/cli-quickstart/e2e-spec.ts @@ -2,10 +2,10 @@ describe('cli-quickstart App', () => { beforeEach(() => { return browser.get('/'); - }) + }); it('should display message saying app works', () => { - var pageTitle = element(by.css('cli-quickstart-app h1')).getText() + let pageTitle = element(by.css('cli-quickstart-app h1')).getText(); expect(pageTitle).toEqual('My First Angular 2 App'); }); }); diff --git a/public/docs/_examples/dependency-injection/ts/app/app.component.ts b/public/docs/_examples/dependency-injection/ts/app/app.component.ts index 21e0d59448..bb330c9441 100644 --- a/public/docs/_examples/dependency-injection/ts/app/app.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/app.component.ts @@ -10,7 +10,7 @@ import { APP_CONFIG, AppConfig, HERO_DI_CONFIG } from './app.config'; import { Logger } from './logger.service'; -import { User, UserService } from './user.service'; +import { UserService } from './user.service'; // #enddocregion imports import { InjectorComponent } from './injector.component'; import { TestComponent } from './test.component'; diff --git a/public/docs/_examples/dependency-injection/ts/app/car/car.component.ts b/public/docs/_examples/dependency-injection/ts/app/car/car.component.ts index f9f982ebd0..9a835ef124 100644 --- a/public/docs/_examples/dependency-injection/ts/app/car/car.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/car/car.component.ts @@ -1,5 +1,5 @@ // #docregion -import { Component, Injector } from '@angular/core'; +import { Component } from '@angular/core'; import { Car, Engine, Tires } from './car'; import { Car as CarNoDi } from './car-no-di'; @@ -27,12 +27,12 @@ import { useInjector } from './car-injector'; providers: [Car, Engine, Tires] }) export class CarComponent { - constructor(public car: Car) {} - factoryCar = (new CarFactory).createCar(); injectorCar = useInjector(); noDiCar = new CarNoDi; simpleCar = simpleCar(); superCar = superCar(); testCar = testCar(); + + constructor(public car: Car) {} } diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.1.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.1.ts index a5a715dbae..dbae4c056c 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.1.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.1.ts @@ -1,7 +1,6 @@ // #docregion import { Injectable } from '@angular/core'; -import { Hero } from './hero'; import { HEROES } from './mock-heroes'; @Injectable() diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.2.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.2.ts index a9d5462818..6b3a98306a 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.2.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.2.ts @@ -1,7 +1,6 @@ // #docregion import { Injectable } from '@angular/core'; -import { Hero } from './hero'; import { HEROES } from './mock-heroes'; import { Logger } from '../logger.service'; diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.ts index 6d058f52d9..fb03ec1de6 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.ts @@ -1,14 +1,11 @@ // #docregion import { Injectable } from '@angular/core'; -import { Hero } from './hero'; import { HEROES } from './mock-heroes'; import { Logger } from '../logger.service'; @Injectable() export class HeroService { - private _user: string; - // #docregion internals constructor( private logger: Logger, diff --git a/public/docs/_examples/dependency-injection/ts/app/providers.component.ts b/public/docs/_examples/dependency-injection/ts/app/providers.component.ts index 74c36d8e62..04089be01d 100644 --- a/public/docs/_examples/dependency-injection/ts/app/providers.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/providers.component.ts @@ -1,7 +1,7 @@ /* tslint:disable:one-line:check-open-brace*/ // Examples of provider arrays // #docplaster -import { Component, Inject, Injectable } from '@angular/core'; +import { Component, Inject, Injectable, OnInit } from '@angular/core'; import { APP_CONFIG, AppConfig, HERO_DI_CONFIG } from './app.config'; @@ -21,7 +21,7 @@ let template = '{{log}}'; providers: [Logger] // #enddocregion providers-1, providers-logger }) -export class ProviderComponent1 { +export class Provider1Component { log: string; constructor(logger: Logger) { logger.log('Hello from logger provided with Logger class'); @@ -38,7 +38,7 @@ export class ProviderComponent1 { [{ provide: Logger, useClass: Logger }] // #enddocregion providers-3 }) -export class ProviderComponent3 { +export class Provider3Component { log: string; constructor(logger: Logger) { logger.log('Hello from logger provided with useClass:Logger'); @@ -57,7 +57,7 @@ class BetterLogger extends Logger {} [{ provide: Logger, useClass: BetterLogger }] // #enddocregion providers-4 }) -export class ProviderComponent4 { +export class Provider4Component { log: string; constructor(logger: Logger) { logger.log('Hello from logger provided with useClass:BetterLogger'); @@ -87,7 +87,7 @@ class EvenBetterLogger extends Logger { { provide: Logger, useClass: EvenBetterLogger }] // #enddocregion providers-5 }) -export class ProviderComponent5 { +export class Provider5Component { log: string; constructor(logger: Logger) { logger.log('Hello from EvenBetterlogger'); @@ -114,7 +114,7 @@ class OldLogger { { provide: OldLogger, useClass: NewLogger}] // #enddocregion providers-6a }) -export class ProviderComponent6a { +export class Provider6aComponent { log: string; constructor(newLogger: NewLogger, oldLogger: OldLogger) { if (newLogger === oldLogger){ @@ -137,7 +137,7 @@ export class ProviderComponent6a { { provide: OldLogger, useExisting: NewLogger}] // #enddocregion providers-6b }) -export class ProviderComponent6b { +export class Provider6bComponent { log: string; constructor(newLogger: NewLogger, oldLogger: OldLogger) { if (newLogger !== oldLogger){ @@ -165,7 +165,7 @@ let silentLogger = { [{ provide: Logger, useValue: silentLogger }] // #enddocregion providers-7 }) -export class ProviderComponent7 { +export class Provider7Component { log: string; constructor(logger: Logger) { logger.log('Hello from logger provided with useValue'); @@ -179,13 +179,13 @@ export class ProviderComponent7 { template: template, providers: [heroServiceProvider, Logger, UserService] }) -export class ProviderComponent8 { +export class Provider8Component { + // must be true else this component would have blown up at runtime + log = 'Hero service injected successfully via heroServiceProvider'; + // #docregion provider-8-ctor constructor(heroService: HeroService) { } // #enddocregion provider-8-ctor - - // must be true else this component would have blown up at runtime - log = 'Hero service injected successfully via heroServiceProvider'; } ///////////////// @@ -202,7 +202,7 @@ export class ProviderComponent8 { providers: [{ provide: APP_CONFIG, useValue: HERO_DI_CONFIG }] // #enddocregion providers-9 }) -export class ProviderComponent9 { +export class Provider9Component implements OnInit { log: string; /* // #docregion provider-9-ctor-interface @@ -225,13 +225,13 @@ export class ProviderComponent9 { import { Optional } from '@angular/core'; // #enddocregion import-optional -let some_message: string = 'Hello from the injected logger'; +let some_message = 'Hello from the injected logger'; @Component({ selector: 'provider-10', template: template }) -export class ProviderComponent10 { +export class Provider10Component implements OnInit { log: string; // #docregion provider-10-ctor constructor(@Optional() private logger: Logger) { @@ -263,16 +263,16 @@ export class ProviderComponent10 {
`, directives: [ - ProviderComponent1, - ProviderComponent3, - ProviderComponent4, - ProviderComponent5, - ProviderComponent6a, - ProviderComponent6b, - ProviderComponent7, - ProviderComponent8, - ProviderComponent9, - ProviderComponent10, + Provider1Component, + Provider3Component, + Provider4Component, + Provider5Component, + Provider6aComponent, + Provider6bComponent, + Provider7Component, + Provider8Component, + Provider9Component, + Provider10Component, ], }) export class ProvidersComponent { } diff --git a/public/docs/_examples/homepage-hello-world/ts/app/hello_world.ts b/public/docs/_examples/homepage-hello-world/ts/app/hello_world.ts index 67850d5749..308bc4547b 100644 --- a/public/docs/_examples/homepage-hello-world/ts/app/hello_world.ts +++ b/public/docs/_examples/homepage-hello-world/ts/app/hello_world.ts @@ -8,7 +8,7 @@ import { Component } from '@angular/core'; // Location of the template for this component templateUrl: 'app/hello_world.html' }) -export class HelloWorld { +export class HelloWorldComponent { // Declaring the variable for binding with initial value yourName: string = ''; diff --git a/public/docs/_examples/homepage-hello-world/ts/app/main.ts b/public/docs/_examples/homepage-hello-world/ts/app/main.ts index 625a9c338f..c0b99d1b7b 100644 --- a/public/docs/_examples/homepage-hello-world/ts/app/main.ts +++ b/public/docs/_examples/homepage-hello-world/ts/app/main.ts @@ -1,6 +1,6 @@ // #docregion import { bootstrap } from '@angular/platform-browser-dynamic'; -import { HelloWorld } from './hello_world'; +import { HelloWorldComponent } from './hello_world'; -bootstrap(HelloWorld); +bootstrap(HelloWorldComponent); diff --git a/public/docs/_examples/homepage-tabs/ts/app/di_demo.ts b/public/docs/_examples/homepage-tabs/ts/app/di_demo.ts index 1e170bcd6f..cbf2e6db57 100644 --- a/public/docs/_examples/homepage-tabs/ts/app/di_demo.ts +++ b/public/docs/_examples/homepage-tabs/ts/app/di_demo.ts @@ -1,7 +1,7 @@ // #docregion import { Component } from '@angular/core'; -import { UiTabs, UiPane } from './ui_tabs'; +import { UiTabsComponent, UiPaneDirective } from './ui_tabs'; class Detail { title: string; @@ -13,23 +13,23 @@ class Detail { template: `

Tabs Demo

-