diff --git a/gulpfile.js b/gulpfile.js index 59e7749515..a8e7e67e04 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -636,7 +636,15 @@ gulp.task('_zip-examples', function() { // Linting gulp.task('lint', function() { - return gulp.src(['./public/docs/_examples/style-guide/ts/**/*.ts', '!./public/docs/_examples/style-guide/ts/**/*.avoid.ts']) + return gulp.src([ + './public/docs/_examples/**/*.ts', + '!./public/docs/_examples/**/ts-snippets/*.ts', + '!./public/docs/_examples/style-guide/ts/**/*.avoid.ts', + '!./public/docs/_examples/**/node_modules/**/*', + '!./public/docs/_examples/_protractor/**/*', + '!./public/docs/_examples/**/typings/**/*', + '!./public/docs/_examples/**/typings-ng1/**/*' + ]) .pipe(tslint({ rulesDirectory: ['node_modules/codelyzer'], configuration: require('./tslint.json') diff --git a/package.json b/package.json index dcc67e9351..2645f4a367 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "browser-sync": "^2.9.3", "canonical-path": "0.0.2", "cross-spawn": "^4.0.0", - "codelyzer": "0.0.20", + "codelyzer": "0.0.22", "del": "^2.2.0", "dgeni": "^0.4.0", "dgeni-packages": "^0.13.0", diff --git a/public/docs/_examples/architecture/ts/app/backend.service.ts b/public/docs/_examples/architecture/ts/app/backend.service.ts index 907a40696e..a49de94fde 100644 --- a/public/docs/_examples/architecture/ts/app/backend.service.ts +++ b/public/docs/_examples/architecture/ts/app/backend.service.ts @@ -13,7 +13,7 @@ const HEROES = [ export class BackendService { constructor(private logger: Logger) {} - getAll(type:Type) : PromiseLike{ + getAll(type: Type): PromiseLike { if (type === Hero) { // TODO get from the database return Promise.resolve(HEROES); diff --git a/public/docs/_examples/architecture/ts/app/hero-detail.component.ts b/public/docs/_examples/architecture/ts/app/hero-detail.component.ts index 579ef637b0..fc2604e53e 100644 --- a/public/docs/_examples/architecture/ts/app/hero-detail.component.ts +++ b/public/docs/_examples/architecture/ts/app/hero-detail.component.ts @@ -1,4 +1,4 @@ -import { Component, Input} from '@angular/core'; +import { Component, Input } from '@angular/core'; import { Hero } from './hero'; diff --git a/public/docs/_examples/architecture/ts/app/sales-tax.component.ts b/public/docs/_examples/architecture/ts/app/sales-tax.component.ts index 6d0c668578..252f8e5b14 100644 --- a/public/docs/_examples/architecture/ts/app/sales-tax.component.ts +++ b/public/docs/_examples/architecture/ts/app/sales-tax.component.ts @@ -35,7 +35,7 @@ export class SalesTaxComponent { constructor(private salesTaxService: SalesTaxService) { } // #enddocregion ctor - getTax(value:string | number){ + getTax(value: string | number) { return this.salesTaxService.getVAT(value); } } 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 813cb4c9c0..f0d5457342 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 { Inject, Injectable } from '@angular/core'; import { TaxRateService } from './tax-rate.service'; @@ -7,9 +7,9 @@ import { TaxRateService } from './tax-rate.service'; @Injectable() export class SalesTaxService { constructor(private rateService: TaxRateService) { } - getVAT(value:string | number){ - let amount:number; - if (typeof value === "string"){ + getVAT(value: string | number) { + let amount: number; + if (typeof value === 'string') { amount = parseFloat(value); } else { amount = value; diff --git a/public/docs/_examples/architecture/ts/app/tax-rate.service.ts b/public/docs/_examples/architecture/ts/app/tax-rate.service.ts index baaa8f49c7..334399f27a 100644 --- a/public/docs/_examples/architecture/ts/app/tax-rate.service.ts +++ b/public/docs/_examples/architecture/ts/app/tax-rate.service.ts @@ -4,6 +4,6 @@ import { Injectable } from '@angular/core'; // #docregion class @Injectable() export class TaxRateService { - getRate(rateName:string){return 0.10;} // always 10% everywhere + getRate(rateName: string) {return 0.10; } // always 10% everywhere } // #enddocregion class diff --git a/public/docs/_examples/attribute-directives/ts/app/app.component.ts b/public/docs/_examples/attribute-directives/ts/app/app.component.ts index 15167310c6..711e98f1e2 100644 --- a/public/docs/_examples/attribute-directives/ts/app/app.component.ts +++ b/public/docs/_examples/attribute-directives/ts/app/app.component.ts @@ -11,4 +11,4 @@ import { HighlightDirective } from './highlight.directive'; export class AppComponent { } -// #enddocregion \ No newline at end of file +// #enddocregion 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 8e64391f05..d6b295fae2 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 @@ -14,12 +14,12 @@ import { Directive, ElementRef, Input } from '@angular/core'; export class HighlightDirective { // #docregion ctor - private el:HTMLElement; + private el: HTMLElement; constructor(el: ElementRef) { this.el = el.nativeElement; } // #enddocregion ctor // #docregion mouse-methods - onMouseEnter() { this.highlight("yellow"); } + onMouseEnter() { this.highlight('yellow'); } onMouseLeave() { this.highlight(null); } private highlight(color: string) { 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 6ec9842602..09a762a892 100644 --- a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts +++ b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts @@ -13,12 +13,12 @@ import { Directive, ElementRef, Input } from '@angular/core'; export class HighlightDirective { private _defaultColor = 'red'; private el: HTMLElement; - + constructor(el: ElementRef) { this.el = el.nativeElement; } // #enddocregion class-1 // #docregion defaultColor - @Input() set defaultColor(colorName:string){ + @Input() set defaultColor(colorName: string){ this._defaultColor = colorName || this._defaultColor; } // #enddocregion defaultColor @@ -33,7 +33,7 @@ export class HighlightDirective { // #enddocregion mouse-enter onMouseLeave() { this.highlight(null); } - private highlight(color:string) { + private highlight(color: string) { this.el.style.backgroundColor = color; } } diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/e2e-spec.ts b/public/docs/_examples/cb-a1-a2-quick-reference/e2e-spec.ts index f75a17ee6e..d0e4bdc850 100644 --- a/public/docs/_examples/cb-a1-a2-quick-reference/e2e-spec.ts +++ b/public/docs/_examples/cb-a1-a2-quick-reference/e2e-spec.ts @@ -85,7 +85,7 @@ describe('Angular 1 to 2 Quick Reference Tests', function () { posterButton.click().then(function () { testImagesAreDisplayed(isDisplayed); - }) + }); } function getMovieRows() { @@ -107,7 +107,7 @@ describe('Angular 1 to 2 Quick Reference Tests', function () { } else { expect(favoriteHeroLabel.isDisplayed()).toBe(false); } - }) - }) + }); + }); } }); 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 99f0699410..286615b95c 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 @@ -11,7 +11,7 @@ import { StringSafeDatePipe } from './date.pipe'; // #docregion component @Component({ selector: 'movie-list', - templateUrl:'app/movie-list.component.html', + templateUrl: 'app/movie-list.component.html', // #enddocregion component // #docregion style-url styleUrls: ['app/movie-list.component.css'], diff --git a/public/docs/_examples/cb-component-communication/e2e-spec.ts b/public/docs/_examples/cb-component-communication/e2e-spec.ts index fc2566662d..8566805c99 100644 --- a/public/docs/_examples/cb-component-communication/e2e-spec.ts +++ b/public/docs/_examples/cb-component-communication/e2e-spec.ts @@ -20,8 +20,8 @@ describe('Component Communication Cookbook Tests', function () { for (let i = 0; i < _heroNames.length; i++) { let childTitle = heroes.get(i).element(by.tagName('h3')).getText(); let childDetail = heroes.get(i).element(by.tagName('p')).getText(); - expect(childTitle).toEqual(_heroNames[i] + ' says:') - expect(childDetail).toContain(_masterName) + expect(childTitle).toEqual(_heroNames[i] + ' says:'); + expect(childDetail).toContain(_masterName); } }); // ... @@ -38,7 +38,7 @@ describe('Component Communication Cookbook Tests', function () { let hero = parent.all(by.tagName('name-child')).get(_nonEmptyNameIndex); let displayName = hero.element(by.tagName('h3')).getText(); - expect(displayName).toEqual(_nonEmptyName) + expect(displayName).toEqual(_nonEmptyName); }); it('should replace empty name with default name', function () { @@ -48,7 +48,7 @@ describe('Component Communication Cookbook Tests', function () { let hero = parent.all(by.tagName('name-child')).get(_emptyNameIndex); let displayName = hero.element(by.tagName('h3')).getText(); - expect(displayName).toEqual(_defaultName) + expect(displayName).toEqual(_defaultName); }); // ... // #enddocregion parent-to-child-setter @@ -83,7 +83,7 @@ describe('Component Communication Cookbook Tests', function () { expect(actual.label).toBe(labelAfter2Minor); expect(actual.count).toBe(3); expect(actual.logs.get(2).getText()).toBe(logAfter2Minor); - }) + }); }); }); @@ -155,11 +155,11 @@ describe('Component Communication Cookbook Tests', function () { // Can't run timer tests in protractor because // interaction w/ zones causes all tests to freeze & timeout. xdescribe('Parent calls child via local var', function() { - countDownTimerTests('countdown-parent-lv') + countDownTimerTests('countdown-parent-lv'); }); xdescribe('Parent calls ViewChild', function() { - countDownTimerTests('countdown-parent-vc') + countDownTimerTests('countdown-parent-vc'); }); function countDownTimerTests(parentTag: string) { 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 5b2442b195..332d8f7f0f 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 @@ -19,7 +19,7 @@ let directives: any[] = [ // Include Countdown examples // unless in e2e tests which they break. if (!/e2e/.test(location.search)) { - console.log('adding countdown timer examples') + console.log('adding countdown timer examples'); directives.push(CountdownLocalVarParentComponent); directives.push(CountdownViewChildParentComponent); } diff --git a/public/docs/_examples/cb-component-communication/ts/app/astronaut.component.ts b/public/docs/_examples/cb-component-communication/ts/app/astronaut.component.ts index 7bda2b100f..bc24964f86 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/astronaut.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/astronaut.component.ts @@ -17,12 +17,12 @@ import { Subscription } from 'rxjs/Subscription';

` }) -export class AstronautComponent implements OnDestroy{ +export class AstronautComponent implements OnDestroy { @Input() astronaut: string; - mission = ""; + mission = ''; confirmed = false; announced = false; - subscription:Subscription; + subscription: Subscription; constructor(private missionService: MissionService) { this.subscription = missionService.missionAnnounced$.subscribe( @@ -30,7 +30,7 @@ export class AstronautComponent implements OnDestroy{ this.mission = mission; this.announced = true; this.confirmed = false; - }) + }); } confirm() { @@ -38,9 +38,9 @@ export class AstronautComponent implements OnDestroy{ this.missionService.confirmMission(this.astronaut); } - ngOnDestroy(){ + ngOnDestroy() { // prevent memory leak when component destroyed this.subscription.unsubscribe(); } } -// #enddocregion \ No newline at end of file +// #enddocregion diff --git a/public/docs/_examples/cb-component-communication/ts/app/countdown-parent.component.ts b/public/docs/_examples/cb-component-communication/ts/app/countdown-parent.component.ts index 95425deef2..a89dee52d9 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/countdown-parent.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/countdown-parent.component.ts @@ -11,7 +11,7 @@ import { CountdownTimerComponent } from './countdown-timer.component'; //// Local variable, #timer, version // #docregion lv @Component({ - selector:'countdown-parent-lv', + selector: 'countdown-parent-lv', template: `

Countdown to Liftoff (via local variable)

@@ -28,7 +28,7 @@ export class CountdownLocalVarParentComponent { } //// View Child version // #docregion vc @Component({ - selector:'countdown-parent-vc', + selector: 'countdown-parent-vc', template: `

Countdown to Liftoff (via ViewChild)

@@ -42,7 +42,7 @@ export class CountdownLocalVarParentComponent { } export class CountdownViewChildParentComponent implements AfterViewInit { @ViewChild(CountdownTimerComponent) - private timerComponent:CountdownTimerComponent; + private timerComponent: CountdownTimerComponent; seconds() { return 0; } @@ -50,10 +50,10 @@ export class CountdownViewChildParentComponent implements AfterViewInit { // Redefine `seconds()` to get from the `CountdownTimerComponent.seconds` ... // but wait a tick first to avoid one-time devMode // unidirectional-data-flow-violation error - setTimeout(() => this.seconds = () => this.timerComponent.seconds, 0) + setTimeout(() => this.seconds = () => this.timerComponent.seconds, 0); } - start(){ this.timerComponent.start(); } + start() { this.timerComponent.start(); } stop() { this.timerComponent.stop(); } } // #enddocregion vc diff --git a/public/docs/_examples/cb-component-communication/ts/app/countdown-timer.component.ts b/public/docs/_examples/cb-component-communication/ts/app/countdown-timer.component.ts index 262ed6f832..a9a1a2fa7c 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/countdown-timer.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/countdown-timer.component.ts @@ -11,7 +11,7 @@ export class CountdownTimerComponent implements OnInit, OnDestroy { message = ''; seconds = 11; - clearTimer() {clearInterval(this.intervalId);} + clearTimer() { clearInterval(this.intervalId); } ngOnInit() { this.start(); } ngOnDestroy() { this.clearTimer(); } diff --git a/public/docs/_examples/cb-component-communication/ts/app/hero.ts b/public/docs/_examples/cb-component-communication/ts/app/hero.ts index 16ce60d8ed..a7b70f48e8 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/hero.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/hero.ts @@ -6,4 +6,4 @@ export const HEROES = [ {name: 'Mr. IQ'}, {name: 'Magneta'}, {name: 'Bombasto'} -]; \ No newline at end of file +]; diff --git a/public/docs/_examples/cb-component-communication/ts/app/main.ts b/public/docs/_examples/cb-component-communication/ts/app/main.ts index 9451f9b495..ad256f0823 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/main.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/main.ts @@ -2,4 +2,4 @@ import { bootstrap } from '@angular/platform-browser-dynamic'; import { AppComponent } from './app.component'; -bootstrap(AppComponent); \ No newline at end of file +bootstrap(AppComponent); diff --git a/public/docs/_examples/cb-component-communication/ts/app/mission.service.ts b/public/docs/_examples/cb-component-communication/ts/app/mission.service.ts index 0c284389b6..25c86866b0 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/mission.service.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/mission.service.ts @@ -1,5 +1,5 @@ // #docregion -import { Injectable } from '@angular/core' +import { Injectable } from '@angular/core'; import { Subject } from 'rxjs/Subject'; @Injectable() @@ -15,7 +15,7 @@ export class MissionService { // Service message commands announceMission(mission: string) { - this.missionAnnouncedSource.next(mission) + this.missionAnnouncedSource.next(mission); } confirmMission(astronaut: string) { diff --git a/public/docs/_examples/cb-component-communication/ts/app/missioncontrol.component.ts b/public/docs/_examples/cb-component-communication/ts/app/missioncontrol.component.ts index eff2b229c9..1c7968bb88 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/missioncontrol.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/missioncontrol.component.ts @@ -21,7 +21,7 @@ import { MissionService } from './mission.service'; providers: [MissionService] }) export class MissionControlComponent { - astronauts = ['Lovell', 'Swigert', 'Haise'] + astronauts = ['Lovell', 'Swigert', 'Haise']; history: string[] = []; missions = ['Fly to the moon!', 'Fly to mars!', @@ -32,7 +32,7 @@ export class MissionControlComponent { missionService.missionConfirmed$.subscribe( astronaut => { this.history.push(`${astronaut} confirmed the mission`); - }) + }); } announce() { diff --git a/public/docs/_examples/cb-component-communication/ts/app/version-child.component.ts b/public/docs/_examples/cb-component-communication/ts/app/version-child.component.ts index 91f5d547f7..72bc07ddb3 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/version-child.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/version-child.component.ts @@ -17,7 +17,7 @@ export class VersionChildComponent implements OnChanges { @Input() minor: number; changeLog: string[] = []; - ngOnChanges(changes: {[propKey:string]: SimpleChange}){ + ngOnChanges(changes: {[propKey: string]: SimpleChange}) { let log: string[] = []; for (let propName in changes) { let changedProp = changes[propName]; diff --git a/public/docs/_examples/cb-component-communication/ts/app/voter.component.ts b/public/docs/_examples/cb-component-communication/ts/app/voter.component.ts index c68409a73a..c0cb23abc0 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/voter.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/voter.component.ts @@ -14,9 +14,9 @@ export class VoterComponent { @Output() onVoted = new EventEmitter(); voted = false; - vote(agreed:boolean){ + vote(agreed: boolean) { this.onVoted.emit(agreed); this.voted = true; } } -// #enddocregion \ No newline at end of file +// #enddocregion diff --git a/public/docs/_examples/cb-component-communication/ts/app/votetaker.component.ts b/public/docs/_examples/cb-component-communication/ts/app/votetaker.component.ts index 3e2970b691..7267185ff1 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/votetaker.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/votetaker.component.ts @@ -18,7 +18,7 @@ import { VoterComponent } from './voter.component'; export class VoteTakerComponent { agreed = 0; disagreed = 0; - voters = ['Mr. IQ', 'Ms. Universe', 'Bombasto'] + voters = ['Mr. IQ', 'Ms. Universe', 'Bombasto']; onVoted(agreed: boolean) { agreed ? this.agreed++ : this.disagreed++; diff --git a/public/docs/_examples/cb-component-relative-paths/e2e-spec.ts b/public/docs/_examples/cb-component-relative-paths/e2e-spec.ts index e39dfdb8a9..e15e664ca4 100644 --- a/public/docs/_examples/cb-component-relative-paths/e2e-spec.ts +++ b/public/docs/_examples/cb-component-relative-paths/e2e-spec.ts @@ -12,7 +12,7 @@ describe('Cookbook: component-relative paths', function () { title: element( by.tagName( 'h1' )), absComp: element( by.css( 'absolute-path div' ) ), relComp: element( by.css( 'relative-path div' ) ) - } + }; } let page: Page; diff --git a/public/docs/_examples/cb-component-relative-paths/ts/app/app.component.ts b/public/docs/_examples/cb-component-relative-paths/ts/app/app.component.ts index 09ccc94591..7ad076d1a1 100644 --- a/public/docs/_examples/cb-component-relative-paths/ts/app/app.component.ts +++ b/public/docs/_examples/cb-component-relative-paths/ts/app/app.component.ts @@ -1,7 +1,7 @@ // #docregion import { Component } from '@angular/core'; -import { SomeAbsoluteComponent, SomeRelativeComponent} from './some.component'; +import { SomeAbsoluteComponent, SomeRelativeComponent } from './some.component'; @Component({ selector: 'my-app', diff --git a/public/docs/_examples/cb-dependency-injection/e2e-spec.ts b/public/docs/_examples/cb-dependency-injection/e2e-spec.ts index 29a8822110..51ae8c485d 100644 --- a/public/docs/_examples/cb-dependency-injection/e2e-spec.ts +++ b/public/docs/_examples/cb-dependency-injection/e2e-spec.ts @@ -66,7 +66,7 @@ describe('Dependency Injection Cookbook', function () { }); it('should highlight Hero Bios and Contacts container when mouseover', function () { - let target = element(by.css('div[myHighlight="yellow"]')) + let target = element(by.css('div[myHighlight="yellow"]')); let yellow = 'rgba(255, 255, 0, 1)'; expect(target.getCssValue('background-color')).not.toEqual(yellow); diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/app.component.ts b/public/docs/_examples/cb-dependency-injection/ts/app/app.component.ts index a72af9e6da..578fb06730 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/app.component.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/app.component.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core'; import { HeroBiosComponent, - HeroBiosAndContactsComponent} from './hero-bios.component'; + HeroBiosAndContactsComponent } from './hero-bios.component'; import { HeroOfTheMonthComponent } from './hero-of-the-month.component'; import { HeroesBaseComponent, SortedHeroesComponent } from './sorted-heroes.component'; 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 b4d122bfe4..d1e44ae1b2 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 @@ -6,9 +6,9 @@ import { HeroCacheService } from './hero-cache.service'; // #docregion component @Component({ - selector:'hero-bio', + selector: 'hero-bio', // #docregion template - template:` + template: `

{{hero.name}}

`, @@ -18,9 +18,9 @@ import { HeroCacheService } from './hero-cache.service'; export class HeroBioComponent implements OnInit { - @Input() heroId:number; + @Input() heroId: number; - constructor(private heroCache:HeroCacheService) { } + constructor(private heroCache: HeroCacheService) { } ngOnInit() { this.heroCache.fetchCachedHero(this.heroId); } 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 05610bb9c9..5ce00bba1a 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 @@ -10,15 +10,15 @@ import { LoggerService } from './logger.service'; //////// HeroBiosComponent //// // #docregion simple @Component({ - selector:'hero-bios', - template:` + selector: 'hero-bios', + template: ` `, - directives:[HeroBioComponent], + directives: [HeroBioComponent], providers: [HeroService] }) -export class HeroBiosComponent{ +export class HeroBiosComponent { // #enddocregion simple // #docregion ctor constructor(logger: LoggerService) { @@ -32,21 +32,21 @@ export class HeroBiosComponent{ //////// HeroBiosAndContactsComponent //// // #docregion hero-bios-and-contacts @Component({ - selector:'hero-bios-and-contacts', + selector: 'hero-bios-and-contacts', // #docregion template - template:` + template: ` `, // #enddocregion template - directives:[HeroBioComponent, HeroContactComponent], + directives: [HeroBioComponent, HeroContactComponent], // #docregion class-provider providers: [HeroService] // #enddocregion class-provider }) -export class HeroBiosAndContactsComponent{ +export class HeroBiosAndContactsComponent { constructor(logger: LoggerService) { logger.logInfo('Creating HeroBiosAndContactsComponent'); } } -// #enddocregion hero-bios-and-contacts \ No newline at end of file +// #enddocregion hero-bios-and-contacts diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero-cache.service.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero-cache.service.ts index c8e6104666..6dbc7a0c4f 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero-cache.service.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero-cache.service.ts @@ -7,14 +7,14 @@ import { HeroService } from './hero.service'; // #docregion service @Injectable() export class HeroCacheService { - hero:Hero; - constructor(private heroService:HeroService){} + hero: Hero; + constructor(private heroService: HeroService) {} - fetchCachedHero(id:number){ + fetchCachedHero(id: number) { if (!this.hero) { this.hero = this.heroService.getHeroById(id); } - return this.hero + return this.hero; } } // #enddocregion service 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 a91f01b104..a2cd8ec75f 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,14 +1,14 @@ // #docplaster // #docregion -import { Component, ElementRef, Host, Inject, Optional } from '@angular/core'; +import { Component, ElementRef, Host, Inject, Optional } from '@angular/core'; import { HeroCacheService } from './hero-cache.service'; import { LoggerService } from './logger.service'; // #docregion component @Component({ - selector:'hero-contact', - template:` + selector: 'hero-contact', + template: `
Phone #: {{phoneNumber}} !!!
` }) diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero-data.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero-data.ts index decccdbf72..10cdbcaab1 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero-data.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero-data.ts @@ -4,10 +4,10 @@ import { Hero } from './hero'; export class HeroData { createDb() { let heroes = [ - new Hero(1,"Windstorm"), - new Hero(2,"Bombasto"), - new Hero(3,"Magneta"), - new Hero(4,"Tornado") + new Hero(1, 'Windstorm'), + new Hero(2, 'Bombasto'), + new Hero(3, 'Magneta'), + new Hero(4, 'Tornado') ]; return {heroes}; } diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero.service.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero.service.ts index 0222f6cd32..9a7bdccd02 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero.service.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero.service.ts @@ -5,18 +5,18 @@ import { Hero } from './hero'; @Injectable() export class HeroService { - //TODO move to database - private heroes:Array = [ - new Hero(1, 'RubberMan','Hero of many talents', '123-456-7899'), - new Hero(2, 'Magma','Hero of all trades', '555-555-5555'), - new Hero(3, 'Mr. Nice','The name says it all','111-222-3333') + // TODO move to database + private heroes: Array = [ + new Hero(1, 'RubberMan', 'Hero of many talents', '123-456-7899'), + new Hero(2, 'Magma', 'Hero of all trades', '555-555-5555'), + new Hero(3, 'Mr. Nice', 'The name says it all', '111-222-3333') ]; - getHeroById(id:number):Hero{ + getHeroById(id: number): Hero { return this.heroes.filter(hero => hero.id === id)[0]; } - getAllHeroes():Array{ + getAllHeroes(): Array { return this.heroes; } } diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/hero.ts b/public/docs/_examples/cb-dependency-injection/ts/app/hero.ts index 51ce8ebbff..c17069e727 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/hero.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/hero.ts @@ -1,9 +1,9 @@ // #docregion -export class Hero{ +export class Hero { constructor( public id: number, - public name:string, - public description?:string, - public phone?:string) { + public name: string, + public description?: string, + public phone?: string) { } -} \ No newline at end of file +} 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 045ce8c545..8d0d8cc466 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 @@ -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 @@ -31,7 +31,7 @@ const provideParent = const provideTheParent = // #docregion provide-the-parent (component: any) => { - return { provide: Parent, useExisting: forwardRef(() => component) } + return { provide: Parent, useExisting: forwardRef(() => component) }; }; // #enddocregion provide-the-parent diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/user-context.service.ts b/public/docs/_examples/cb-dependency-injection/ts/app/user-context.service.ts index 782e65043d..ed394fc734 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/user-context.service.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/user-context.service.ts @@ -9,19 +9,19 @@ import { UserService } from './user.service'; @Injectable() export class UserContextService { // #enddocregion injectables, injectable - name:string; - role:string; - loggedInSince:Date; + name: string; + role: string; + loggedInSince: Date; // #docregion ctor, injectables - constructor(private userService:UserService, private loggerService:LoggerService){ + constructor(private userService: UserService, private loggerService: LoggerService) { // #enddocregion ctor, injectables this.loggedInSince = new Date(); // #docregion ctor, injectables } // #enddocregion ctor, injectables - loadUser(userId:number){ + loadUser(userId: number) { let user = this.userService.getUserById(userId); this.name = user.name; this.role = user.role; diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/user.service.ts b/public/docs/_examples/cb-dependency-injection/ts/app/user.service.ts index d4ca4fda2a..c48b025a08 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/user.service.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/user.service.ts @@ -4,7 +4,7 @@ import { Injectable } from '@angular/core'; @Injectable() export class UserService { - getUserById(userId:number):any{ - return {name:'Bombasto',role:'Admin'}; + getUserById(userId: number): any { + return {name: 'Bombasto', role: 'Admin'}; } } diff --git a/public/docs/_examples/cb-dynamic-form/e2e-spec.ts b/public/docs/_examples/cb-dynamic-form/e2e-spec.ts index d526626b24..3915d9cf90 100644 --- a/public/docs/_examples/cb-dynamic-form/e2e-spec.ts +++ b/public/docs/_examples/cb-dynamic-form/e2e-spec.ts @@ -15,7 +15,7 @@ describe('Dynamic Form', function () { emailElement.sendKeys(email); expect(emailElement.getAttribute('value')).toEqual(email); - element(by.css('select option[value="solid"]')).click() + element(by.css('select option[value="solid"]')).click(); let saveButton = element.all(by.css('button')).get(0); saveButton.click().then(function(){ 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 01a5401003..74a4909de3 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,5 +1,5 @@ // #docregion -import { Component } from '@angular/core' +import { Component } from '@angular/core'; import { DynamicForm } from './dynamic-form.component'; import { QuestionService } from './question.service'; @@ -16,7 +16,7 @@ import { QuestionService } from './question.service'; providers: [QuestionService] }) export class AppComponent { - questions:any[] + questions: any[]; constructor(service: QuestionService) { this.questions = service.getQuestions(); diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form-question.component.ts b/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form-question.component.ts index d039931f61..0593fd523e 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form-question.component.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/dynamic-form-question.component.ts @@ -5,11 +5,11 @@ import { ControlGroup } from '@angular/common'; import { QuestionBase } from './question-base'; @Component({ - selector:'df-question', - templateUrl:'app/dynamic-form-question.component.html' + selector: 'df-question', + templateUrl: 'app/dynamic-form-question.component.html' }) export class DynamicFormQuestionComponent { - @Input() question:QuestionBase; - @Input() form:ControlGroup; + @Input() question: QuestionBase; + @Input() form: ControlGroup; get isValid() { return this.form.controls[this.question.key].valid; } } 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 68aafc839b..a6374871ab 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 @@ -7,8 +7,8 @@ import { QuestionControlService } from './question-control.service'; import { DynamicFormQuestionComponent } from './dynamic-form-question.component'; @Component({ - selector:'dynamic-form', - templateUrl:'app/dynamic-form.component.html', + selector: 'dynamic-form', + templateUrl: 'app/dynamic-form.component.html', directives: [DynamicFormQuestionComponent], providers: [QuestionControlService] }) @@ -20,7 +20,7 @@ export class DynamicForm { constructor(private qcs: QuestionControlService) { } - ngOnInit(){ + ngOnInit() { this.form = this.qcs.toControlGroup(this.questions); } diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/main.ts b/public/docs/_examples/cb-dynamic-form/ts/app/main.ts index aca0a06056..5a8d9c5044 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/main.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/main.ts @@ -3,4 +3,4 @@ import { bootstrap } from '@angular/platform-browser-dynamic'; import { AppComponent } from './app.component'; bootstrap(AppComponent, []) - .catch((err:any) => console.error(err)); + .catch((err: any) => console.error(err)); diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/question-base.ts b/public/docs/_examples/cb-dynamic-form/ts/app/question-base.ts index c22de02989..2b32b00f2a 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/question-base.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/question-base.ts @@ -1,20 +1,20 @@ // #docregion export class QuestionBase{ - value:T; - key:string; - label:string; - required:boolean; - order:number; - controlType:string; + value: T; + key: string; + label: string; + required: boolean; + order: number; + controlType: string; - constructor(options:{ - value?:T, - key?:string, - label?:string, - required?:boolean, - order?:number, - controlType?:string - } = {}){ + constructor(options: { + value?: T, + key?: string, + label?: string, + required?: boolean, + order?: number, + controlType?: string + } = {}) { this.value = options.value; this.key = options.key || ''; this.label = options.label || ''; 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 d4cf25951c..fb86366c51 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 @@ -5,9 +5,9 @@ import { QuestionBase } from './question-base'; @Injectable() export class QuestionControlService { - constructor(private fb:FormBuilder){ } + constructor(private fb: FormBuilder) { } - toControlGroup(questions:QuestionBase[] ) { + toControlGroup(questions: QuestionBase[] ) { let group = {}; questions.forEach(question => { diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/question-dropdown.ts b/public/docs/_examples/cb-dynamic-form/ts/app/question-dropdown.ts index 50b5d64a1d..35a9074c74 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/question-dropdown.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/question-dropdown.ts @@ -1,11 +1,11 @@ // #docregion import { QuestionBase } from './question-base'; -export class DropdownQuestion extends QuestionBase{ +export class DropdownQuestion extends QuestionBase { controlType = 'dropdown'; - options:{key:string, value:string}[] = []; + options: {key: string, value: string}[] = []; - constructor(options:{} = {}){ + constructor(options: {} = {}) { super(options); this.options = options['options'] || []; } diff --git a/public/docs/_examples/cb-dynamic-form/ts/app/question-textbox.ts b/public/docs/_examples/cb-dynamic-form/ts/app/question-textbox.ts index a1c9980de5..aaa7edf267 100644 --- a/public/docs/_examples/cb-dynamic-form/ts/app/question-textbox.ts +++ b/public/docs/_examples/cb-dynamic-form/ts/app/question-textbox.ts @@ -1,11 +1,11 @@ // #docregion import { QuestionBase } from './question-base'; -export class TextboxQuestion extends QuestionBase{ +export class TextboxQuestion extends QuestionBase { controlType = 'textbox'; - type:string; + type: string; - constructor(options:{} = {}){ + constructor(options: {} = {}) { super(options); this.type = options['type'] || ''; } 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 52b4fc70ff..7ba417ee3c 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 @@ -13,36 +13,36 @@ export class QuestionService { // Todo: make asynchronous getQuestions() { - let questions:QuestionBase[] = [ + let questions: QuestionBase[] = [ new DropdownQuestion({ - key:'brave', + key: 'brave', label: 'Bravery Rating', options: [ - {key:'solid', value:'Solid'}, - {key:'great', value:'Great'}, - {key:'good', value:'Good'}, - {key:'unproven',value:'Unproven'} + {key: 'solid', value: 'Solid'}, + {key: 'great', value: 'Great'}, + {key: 'good', value: 'Good'}, + {key: 'unproven', value: 'Unproven'} ], order: 3 }), new TextboxQuestion({ - key:'firstName', - label:'First name', - value:'Bombasto', + key: 'firstName', + label: 'First name', + value: 'Bombasto', required: true, order: 1 }), new TextboxQuestion({ - key:'emailAddress', - label:'Email', + key: 'emailAddress', + label: 'Email', type: 'email', order: 2 }) ]; - return questions.sort((a,b) => a.order - b.order); + return questions.sort((a, b) => a.order - b.order); } } diff --git a/public/docs/_examples/cb-set-document-title/ts/app/main.ts b/public/docs/_examples/cb-set-document-title/ts/app/main.ts index c5134d3214..abee7afb87 100644 --- a/public/docs/_examples/cb-set-document-title/ts/app/main.ts +++ b/public/docs/_examples/cb-set-document-title/ts/app/main.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ // #docregion import { bootstrap } from '@angular/platform-browser-dynamic'; diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject-additional.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject-additional.component.ts index 6ed0b9166d..da11e56b8a 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject-additional.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject-additional.component.ts @@ -21,11 +21,11 @@ export class TitleComponent { constructor( @Inject('titlePrefix') @Optional() - private titlePrefix:string, + private titlePrefix: string, @Attribute('title') - private title:string, + private title: string, @Query('okMsg') - private msg:QueryList) { + private msg: QueryList) { } ok() { diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject.component.ts index 5d78a5cbbf..4865f9eb22 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/hero-di-inject.component.ts @@ -8,7 +8,7 @@ import { Component, Inject } from '@angular/core'; export class HeroComponent { constructor( @Inject('heroName') - private name:string) { + private name: string) { } } // #enddocregion diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/hero-di.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/hero-di.component.ts index e6b81b6af7..2f3fa267ba 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/hero-di.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/hero-di.component.ts @@ -8,8 +8,8 @@ import { DataService } from './data.service'; template: `

Hero: {{name}}

` }) export class HeroComponent { - name:string; - constructor(dataService:DataService) { + name: string; + constructor(dataService: DataService) { this.name = dataService.getHeroName(); } } diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/hero-io.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/hero-io.component.ts index 936bf2854e..a93b9ed08c 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/hero-io.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/hero-io.component.ts @@ -13,8 +13,8 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; ` }) export class ConfirmComponent { - @Input() okMsg:string; - @Input('cancelMsg') notOkMsg:string; + @Input() okMsg: string; + @Input('cancelMsg') notOkMsg: string; @Output() ok = new EventEmitter(); @Output('cancel') notOk = @@ -44,8 +44,8 @@ export class ConfirmComponent { directives: [ConfirmComponent] }) export class AppComponent { - okClicked:boolean; - cancelClicked:boolean; + okClicked: boolean; + cancelClicked: boolean; onOk() { this.okClicked = true; diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/hero-lifecycle.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/hero-lifecycle.component.ts index 94d79274fc..c883658135 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/hero-lifecycle.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/hero-lifecycle.component.ts @@ -11,7 +11,7 @@ import { Component, OnInit } // #docregion export class HeroComponent implements OnInit { - name:string; + name: string; ngOnInit() { this.name = 'Windstorm'; } diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/hero.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/hero.component.ts index 85d2772c63..a1628a1104 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/hero.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/hero.component.ts @@ -4,14 +4,14 @@ import { Component } from '@angular/core'; @Component({ selector: 'hero-view', - template: + template: '

Hero: {{getName()}}

' }) // #docregion appexport // #docregion class export class HeroComponent { title = 'Hero Detail'; - getName() {return 'Windstorm';} + getName() {return 'Windstorm'; } } // #enddocregion class // #enddocregion appexport diff --git a/public/docs/_examples/cb-ts-to-js/ts/app/heroes-bindings.component.ts b/public/docs/_examples/cb-ts-to-js/ts/app/heroes-bindings.component.ts index 317d434b9d..71c75bb5c8 100644 --- a/public/docs/_examples/cb-ts-to-js/ts/app/heroes-bindings.component.ts +++ b/public/docs/_examples/cb-ts-to-js/ts/app/heroes-bindings.component.ts @@ -10,8 +10,8 @@ import { Component, HostBinding, HostListener } from '@angular/core'; export class HeroesComponent { @HostBinding() title = 'Tooltip content'; @HostBinding('class.heading') - hClass = true - active:boolean; + hClass = true; + active: boolean; constructor() {} @@ -21,7 +21,7 @@ export class HeroesComponent { } @HostListener('dblclick', ['$event']) - doubleClicked(evt:Event) { + doubleClicked(evt: Event) { this.active = true; } } 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 68ccb975e7..be8176e951 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 @@ -14,7 +14,7 @@ import { ` }) class ActiveLabelComponent { - active:boolean; + active: boolean; activate() { this.active = true; @@ -30,11 +30,11 @@ class ActiveLabelComponent { ` }) class HeroComponent { - @Input() hero:any; - active:boolean; + @Input() hero: any; + active: boolean; @ContentChild(ActiveLabelComponent) - label:ActiveLabelComponent + label: ActiveLabelComponent; activate() { this.active = true; @@ -68,7 +68,7 @@ export class HeroesQueriesComponent { ]; @ViewChildren(HeroComponent) - heroCmps:QueryList; + heroCmps: QueryList; activate() { this.heroCmps.forEach( 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 ea8f8377e1..340b0b9a0d 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,8 +1,6 @@ // #docregion ng2import import { bootstrap } from '@angular/platform-browser-dynamic'; -import { -} from '@angular/router'; import { LocationStrategy, HashLocationStrategy diff --git a/public/docs/_examples/component-styles/ts/app/hero-app.component.ts b/public/docs/_examples/component-styles/ts/app/hero-app.component.ts index b196584abb..7386226e71 100644 --- a/public/docs/_examples/component-styles/ts/app/hero-app.component.ts +++ b/public/docs/_examples/component-styles/ts/app/hero-app.component.ts @@ -16,7 +16,7 @@ export class HeroAppComponent { hero = new Hero( 'Human Torch', ['Mister Fantastic', 'Invisible Woman', 'Thing'] - ) + ); @HostBinding('class') get themeClass() { return 'theme-light'; diff --git a/public/docs/_examples/component-styles/ts/app/hero.ts b/public/docs/_examples/component-styles/ts/app/hero.ts index 8b58c8a8f8..7f8969e682 100644 --- a/public/docs/_examples/component-styles/ts/app/hero.ts +++ b/public/docs/_examples/component-styles/ts/app/hero.ts @@ -1,7 +1,7 @@ export class Hero { - active:boolean; + active: boolean; - constructor(public name:string, - public team:string[]) { + constructor(public name: string, + public team: string[]) { } } diff --git a/public/docs/_examples/dependency-injection/e2e-spec.ts b/public/docs/_examples/dependency-injection/e2e-spec.ts index 1f7226867d..d4625478f3 100644 --- a/public/docs/_examples/dependency-injection/e2e-spec.ts +++ b/public/docs/_examples/dependency-injection/e2e-spec.ts @@ -123,7 +123,7 @@ describe('Dependency Injection Tests', function () { it('P10 (optional dependency) displays as expected', function () { expectedMsg = 'Optional logger was not available'; expect(element(by.css('#p10')).getText()).toEqual(expectedMsg); - }) + }); }); describe('User/Heroes:', function() { @@ -163,8 +163,8 @@ describe('Dependency Injection Tests', function () { describe('after button click', function() { beforeAll(function (done) { - let buttonEle = element.all(by.cssContainingText('button','Next User')).get(0); - buttonEle.click().then(done,done); + let buttonEle = element.all(by.cssContainingText('button', 'Next User')).get(0); + buttonEle.click().then(done, done); }); it('User is Alice - authorized', function () { diff --git a/public/docs/_examples/dependency-injection/ts/app/app.component.1.ts b/public/docs/_examples/dependency-injection/ts/app/app.component.1.ts index bec40f397d..a67946ac19 100644 --- a/public/docs/_examples/dependency-injection/ts/app/app.component.1.ts +++ b/public/docs/_examples/dependency-injection/ts/app/app.component.1.ts @@ -13,7 +13,7 @@ import { HeroesComponent } from './heroes/heroes.component.1'; `, - directives:[CarComponent, HeroesComponent] + directives: [CarComponent, HeroesComponent] }) export class AppComponent { diff --git a/public/docs/_examples/dependency-injection/ts/app/app.component.2.ts b/public/docs/_examples/dependency-injection/ts/app/app.component.2.ts index 78e3f5483e..a6106cbc4b 100644 --- a/public/docs/_examples/dependency-injection/ts/app/app.component.2.ts +++ b/public/docs/_examples/dependency-injection/ts/app/app.component.2.ts @@ -17,7 +17,7 @@ import { Logger } from './logger.service'; `, - directives:[CarComponent, HeroesComponent], + directives: [CarComponent, HeroesComponent], providers: [ Logger, // #docregion providers @@ -26,10 +26,10 @@ import { Logger } from './logger.service'; ] }) export class AppComponent { - title:string; + title: string; // #docregion ctor - constructor(@Inject(APP_CONFIG) config:AppConfig) { + constructor(@Inject(APP_CONFIG) config: AppConfig) { this.title = config.title; } // #enddocregion ctor 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 659d5c1faf..21e0d59448 100644 --- a/public/docs/_examples/dependency-injection/ts/app/app.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/app.component.ts @@ -31,7 +31,7 @@ import { ProvidersComponent } from './providers.component'; `, - directives:[CarComponent, HeroesComponent, + directives: [CarComponent, HeroesComponent, InjectorComponent, TestComponent, ProvidersComponent], // #docregion providers providers: [ @@ -42,22 +42,22 @@ import { ProvidersComponent } from './providers.component'; // #enddocregion providers }) export class AppComponent { - title:string; + title: string; // #docregion ctor constructor( - @Inject(APP_CONFIG) config:AppConfig, + @Inject(APP_CONFIG) config: AppConfig, private userService: UserService) { this.title = config.title; } // #enddocregion ctor - get isAuthorized() { return this.user.isAuthorized;} + get isAuthorized() { return this.user.isAuthorized; } nextUser() { this.userService.getNewUser(); } get user() { return this.userService.user; } get userInfo() { - return `Current user, ${this.user.name}, is `+ + return `Current user, ${this.user.name}, is ` + `${this.isAuthorized ? '' : 'not'} authorized. `; } } diff --git a/public/docs/_examples/dependency-injection/ts/app/app.config.ts b/public/docs/_examples/dependency-injection/ts/app/app.config.ts index fcffa83628..7626c46e5b 100644 --- a/public/docs/_examples/dependency-injection/ts/app/app.config.ts +++ b/public/docs/_examples/dependency-injection/ts/app/app.config.ts @@ -4,10 +4,10 @@ import { OpaqueToken } from '@angular/core'; export let APP_CONFIG = new OpaqueToken('app.config'); // #enddocregion token -//#docregion config +// #docregion config export interface AppConfig { - apiEndpoint: string, - title: string + apiEndpoint: string; + title: string; } export const HERO_DI_CONFIG: AppConfig = { diff --git a/public/docs/_examples/dependency-injection/ts/app/car/car-creations.ts b/public/docs/_examples/dependency-injection/ts/app/car/car-creations.ts index 2693ba37ca..c758c72951 100644 --- a/public/docs/_examples/dependency-injection/ts/app/car/car-creations.ts +++ b/public/docs/_examples/dependency-injection/ts/app/car/car-creations.ts @@ -5,42 +5,42 @@ import { Car, Engine, Tires } from './car'; ///////// example 1 //////////// export function simpleCar() { - //#docregion car-ctor-instantiation + // #docregion car-ctor-instantiation // Simple car with 4 cylinders and Flintstone tires. - var car = new Car(new Engine(), new Tires()); - //#enddocregion car-ctor-instantiation + let car = new Car(new Engine(), new Tires()); + // #enddocregion car-ctor-instantiation car.description = 'Simple'; return car; } ///////// example 2 //////////// -//#docregion car-ctor-instantiation-with-param +// #docregion car-ctor-instantiation-with-param class Engine2 { constructor(public cylinders: number) { } } -//#enddocregion car-ctor-instantiation-with-param +// #enddocregion car-ctor-instantiation-with-param export function superCar() { -//#docregion car-ctor-instantiation-with-param +// #docregion car-ctor-instantiation-with-param // Super car with 12 cylinders and Flintstone tires. - var bigCylinders = 12; - var car = new Car(new Engine2(bigCylinders), new Tires()); -//#enddocregion car-ctor-instantiation-with-param + let bigCylinders = 12; + let car = new Car(new Engine2(bigCylinders), new Tires()); +// #enddocregion car-ctor-instantiation-with-param car.description = 'Super'; return car; } /////////// example 3 ////////// - //#docregion car-ctor-instantiation-with-mocks + // #docregion car-ctor-instantiation-with-mocks class MockEngine extends Engine { cylinders = 8; } - class MockTires extends Tires { make = "YokoGoodStone"; } + class MockTires extends Tires { make = 'YokoGoodStone'; } - //#enddocregion car-ctor-instantiation-with-mocks + // #enddocregion car-ctor-instantiation-with-mocks export function testCar() { - //#docregion car-ctor-instantiation-with-mocks + // #docregion car-ctor-instantiation-with-mocks // Test car with 8 cylinders and YokoGoodStone tires. - var car = new Car(new MockEngine(), new MockTires()); - //#enddocregion car-ctor-instantiation-with-mocks + let car = new Car(new MockEngine(), new MockTires()); + // #enddocregion car-ctor-instantiation-with-mocks car.description = 'Test'; return car; } diff --git a/public/docs/_examples/dependency-injection/ts/app/car/car-injector.ts b/public/docs/_examples/dependency-injection/ts/app/car/car-injector.ts index 04d379785f..4f7498ee4e 100644 --- a/public/docs/_examples/dependency-injection/ts/app/car/car-injector.ts +++ b/public/docs/_examples/dependency-injection/ts/app/car/car-injector.ts @@ -5,23 +5,23 @@ import { Logger } from '../logger.service'; // #docregion injector export function useInjector() { - var injector: ReflectiveInjector; + let injector: ReflectiveInjector; // #enddocregion injector /* // #docregion injector-no-new // Cannot instantiate an ReflectiveInjector like this! - var injector = new ReflectiveInjector([Car, Engine, Tires]); + let injector = new ReflectiveInjector([Car, Engine, Tires]); // #enddocregion injector-no-new */ // #docregion injector, injector-create-and-call injector = ReflectiveInjector.resolveAndCreate([Car, Engine, Tires]); // #docregion injector-call - var car = injector.get(Car); + let car = injector.get(Car); // #enddocregion injector-call, injector-create-and-call car.description = 'Injector'; injector = ReflectiveInjector.resolveAndCreate([Logger]); - var logger = injector.get(Logger); - logger.log('Injector car.drive() said: '+car.drive()); + let logger = injector.get(Logger); + logger.log('Injector car.drive() said: ' + car.drive()); return car; } diff --git a/public/docs/_examples/dependency-injection/ts/app/car/car-no-di.ts b/public/docs/_examples/dependency-injection/ts/app/car/car-no-di.ts index 059dccd4b7..9026edebc2 100644 --- a/public/docs/_examples/dependency-injection/ts/app/car/car-no-di.ts +++ b/public/docs/_examples/dependency-injection/ts/app/car/car-no-di.ts @@ -1,10 +1,10 @@ // Car without DI import { Engine, Tires } from './car'; -//#docregion car +// #docregion car export class Car { - //#docregion car-ctor + // #docregion car-ctor public engine: Engine; public tires: Tires; public description = 'No DI'; @@ -13,12 +13,12 @@ export class Car { this.engine = new Engine(); this.tires = new Tires(); } - //#enddocregion car-ctor + // #enddocregion car-ctor // Method using the engine and tires drive() { return `${this.description} car with ` + - `${this.engine.cylinders} cylinders and ${this.tires.make} tires.` + `${this.engine.cylinders} cylinders and ${this.tires.make} tires.`; } } -//#enddocregion car \ No newline at end of file +// #enddocregion car diff --git a/public/docs/_examples/dependency-injection/ts/app/car/car.ts b/public/docs/_examples/dependency-injection/ts/app/car/car.ts index 0e4a4a1415..37162c570b 100644 --- a/public/docs/_examples/dependency-injection/ts/app/car/car.ts +++ b/public/docs/_examples/dependency-injection/ts/app/car/car.ts @@ -11,7 +11,7 @@ export class Tires { @Injectable() export class Car { - //#docregion car-ctor + // #docregion car-ctor public description = 'DI'; constructor(public engine: Engine, public tires: Tires) { } @@ -20,6 +20,6 @@ export class Car { // Method using the engine and tires drive() { return `${this.description} car with ` + - `${this.engine.cylinders} cylinders and ${this.tires.make} tires.` + `${this.engine.cylinders} cylinders and ${this.tires.make} tires.`; } } diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/hero-list.component.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/hero-list.component.ts index e841669661..db3a325bdb 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/hero-list.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/hero-list.component.ts @@ -1,3 +1,4 @@ +/* tslint:disable:one-line */ // #docregion import { Component } from '@angular/core'; 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 0947d60494..a9d5462818 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 @@ -8,12 +8,12 @@ import { Logger } from '../logger.service'; @Injectable() export class HeroService { - //#docregion ctor + // #docregion ctor constructor(private logger: Logger) { } - //#enddocregion ctor + // #enddocregion ctor getHeroes() { - this.logger.log('Getting heroes ...') + this.logger.log('Getting heroes ...'); return HEROES; } } diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.provider.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.provider.ts index 557e9b9534..13008f0109 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.provider.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/hero.service.provider.ts @@ -1,3 +1,4 @@ +/* tslint:disable:one-line */ // #docregion import { HeroService } from './hero.service'; import { Logger } from '../logger.service'; @@ -6,7 +7,7 @@ import { UserService } from '../user.service'; // #docregion factory let heroServiceFactory = (logger: Logger, userService: UserService) => { return new HeroService(logger, userService.user.isAuthorized); -} +}; // #enddocregion factory // #docregion provider 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 7e84ae5058..6d058f52d9 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 @@ -7,7 +7,7 @@ import { Logger } from '../logger.service'; @Injectable() export class HeroService { - private _user:string; + private _user: string; // #docregion internals constructor( @@ -15,7 +15,7 @@ export class HeroService { private isAuthorized: boolean) { } getHeroes() { - let auth = this.isAuthorized ? 'authorized ': 'unauthorized'; + let auth = this.isAuthorized ? 'authorized ' : 'unauthorized'; this.logger.log(`Getting heroes for ${auth} user.`); return HEROES.filter(hero => this.isAuthorized || !hero.isSecret); } diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/heroes.component.1.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/heroes.component.1.ts index 247b8c7841..9d25972eb0 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/heroes.component.1.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/heroes.component.1.ts @@ -21,8 +21,8 @@ import { HeroService } from './hero.service'; `, // #enddocregion v1 - providers:[HeroService], + providers: [HeroService], // #docregion v1 - directives:[HeroListComponent] + directives: [HeroListComponent] }) export class HeroesComponent { } diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/heroes.component.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/heroes.component.ts index de46be16c3..dd2346248c 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/heroes.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/heroes.component.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core'; import { HeroListComponent } from './hero-list.component'; -import { heroServiceProvider} from './hero.service.provider'; +import { heroServiceProvider } from './hero.service.provider'; @Component({ selector: 'my-heroes', @@ -10,7 +10,7 @@ import { heroServiceProvider} from './hero.service.provider';

Heroes

`, - providers:[heroServiceProvider], - directives:[HeroListComponent] + providers: [heroServiceProvider], + directives: [HeroListComponent] }) export class HeroesComponent { } diff --git a/public/docs/_examples/dependency-injection/ts/app/heroes/mock-heroes.ts b/public/docs/_examples/dependency-injection/ts/app/heroes/mock-heroes.ts index 98695e90ce..79a91dc03a 100644 --- a/public/docs/_examples/dependency-injection/ts/app/heroes/mock-heroes.ts +++ b/public/docs/_examples/dependency-injection/ts/app/heroes/mock-heroes.ts @@ -2,14 +2,14 @@ import { Hero } from './hero'; export var HEROES: Hero[] = [ - { id: 11, isSecret: false, name: "Mr. Nice" }, - { id: 12, isSecret: false, name: "Narco" }, - { id: 13, isSecret: false, name: "Bombasto" }, - { id: 14, isSecret: false, name: "Celeritas" }, - { id: 15, isSecret: false, name: "Magneta" }, - { id: 16, isSecret: false, name: "RubberMan" }, - { id: 17, isSecret: false, name: "Dynama" }, - { id: 18, isSecret: true, name: "Dr IQ" }, - { id: 19, isSecret: true, name: "Magma" }, - { id: 20, isSecret: true, name: "Tornado" } + { id: 11, isSecret: false, name: 'Mr. Nice' }, + { id: 12, isSecret: false, name: 'Narco' }, + { id: 13, isSecret: false, name: 'Bombasto' }, + { id: 14, isSecret: false, name: 'Celeritas' }, + { id: 15, isSecret: false, name: 'Magneta' }, + { id: 16, isSecret: false, name: 'RubberMan' }, + { id: 17, isSecret: false, name: 'Dynama' }, + { id: 18, isSecret: true, name: 'Dr IQ' }, + { id: 19, isSecret: true, name: 'Magma' }, + { id: 20, isSecret: true, name: 'Tornado' } ]; diff --git a/public/docs/_examples/dependency-injection/ts/app/injector.component.ts b/public/docs/_examples/dependency-injection/ts/app/injector.component.ts index 84c8de4a95..7c9e8a56e5 100644 --- a/public/docs/_examples/dependency-injection/ts/app/injector.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/injector.component.ts @@ -20,8 +20,6 @@ import { Logger } from './logger.service'; providers: [Car, Engine, Tires, heroServiceProvider, Logger] }) export class InjectorComponent { - constructor(private injector: Injector) { } - car: Car = this.injector.get(Car); // #docregion get-hero-service @@ -29,8 +27,10 @@ export class InjectorComponent { // #enddocregion get-hero-service hero: Hero = this.heroService.getHeroes()[0]; + constructor(private injector: Injector) { } + get rodent() { - let rousDontExist = "R.O.U.S.'s? I don't think they exist!"; + let rousDontExist = `R.O.U.S.'s? I don't think they exist!`; return this.injector.get(ROUS, rousDontExist); } } diff --git a/public/docs/_examples/dependency-injection/ts/app/logger.service.ts b/public/docs/_examples/dependency-injection/ts/app/logger.service.ts index 4812ccd3ac..e943523ad2 100644 --- a/public/docs/_examples/dependency-injection/ts/app/logger.service.ts +++ b/public/docs/_examples/dependency-injection/ts/app/logger.service.ts @@ -3,7 +3,7 @@ import { Injectable } from '@angular/core'; @Injectable() export class Logger { - logs:string[] = []; // capture logs for testing + logs: string[] = []; // capture logs for testing log(message: string) { this.logs.push(message); diff --git a/public/docs/_examples/dependency-injection/ts/app/main.1.ts b/public/docs/_examples/dependency-injection/ts/app/main.1.ts index 56169511d5..0d83503360 100644 --- a/public/docs/_examples/dependency-injection/ts/app/main.1.ts +++ b/public/docs/_examples/dependency-injection/ts/app/main.1.ts @@ -1,3 +1,4 @@ +/* tslint:disable:no-unused-variable */ import { bootstrap } from '@angular/platform-browser-dynamic'; import { AppComponent } from './app.component.1'; import { HeroService } from './heroes/hero.service.1'; @@ -5,8 +6,8 @@ import { HeroService } from './heroes/hero.service.1'; bootstrap(AppComponent); function discouraged() { - //#docregion bootstrap-discouraged + // #docregion bootstrap-discouraged bootstrap(AppComponent, [HeroService]); // DISCOURAGED (but works) - //#enddocregion bootstrap-discouraged + // #enddocregion bootstrap-discouraged } diff --git a/public/docs/_examples/dependency-injection/ts/app/main.ts b/public/docs/_examples/dependency-injection/ts/app/main.ts index 8e480e8d7f..2f002de7d9 100644 --- a/public/docs/_examples/dependency-injection/ts/app/main.ts +++ b/public/docs/_examples/dependency-injection/ts/app/main.ts @@ -2,7 +2,7 @@ import { bootstrap } from '@angular/platform-browser-dynamic'; import { AppComponent } from './app.component'; import { ProvidersComponent } from './providers.component'; -//#docregion bootstrap +// #docregion bootstrap bootstrap(AppComponent); -//#enddocregion bootstrap +// #enddocregion bootstrap bootstrap(ProvidersComponent); 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 640247d4b6..61c53bb862 100644 --- a/public/docs/_examples/dependency-injection/ts/app/providers.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/providers.component.ts @@ -235,8 +235,9 @@ export class ProviderComponent10 { log: string; // #docregion provider-10-ctor constructor(@Optional() private logger: Logger) { - if (this.logger) + if (this.logger) { this.logger.log(some_message); + } } // #enddocregion provider-10-ctor diff --git a/public/docs/_examples/dependency-injection/ts/app/test.component.ts b/public/docs/_examples/dependency-injection/ts/app/test.component.ts index 068cf65e7b..fc0fef75a8 100644 --- a/public/docs/_examples/dependency-injection/ts/app/test.component.ts +++ b/public/docs/_examples/dependency-injection/ts/app/test.component.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ // Simulate a simple test // Reader should look to the testing chapter for the real thing @@ -20,15 +21,15 @@ export class TestComponent { ///////////////////////////////////// function runTests() { - //#docregion spec + // #docregion spec let expectedHeroes = [{name: 'A'}, {name: 'B'}] let mockService = {getHeroes: () => expectedHeroes } - it("should have heroes when HeroListComponent created", () => { + it('should have heroes when HeroListComponent created', () => { let hlc = new HeroListComponent(mockService); expect(hlc.heroes.length).toEqual(expectedHeroes.length); - }) - //#enddocregion spec + }); + // #enddocregion spec return testResults; } @@ -36,19 +37,19 @@ function runTests() { ////////////////////////////////// // Fake Jasmine infrastructure var testName: string; -var testResults: {pass:string; message:string}; +var testResults: {pass: string; message: string}; -function expect(actual:any) { +function expect(actual: any) { return { - toEqual: function(expected:any){ - testResults = actual === expected? - {pass:'passed', message: testName} : - {pass:'failed', message: `${testName}; expected ${actual} to equal ${expected}.`}; + toEqual: function(expected: any){ + testResults = actual === expected ? + {pass: 'passed', message: testName} : + {pass: 'failed', message: `${testName}; expected ${actual} to equal ${expected}.`}; } - } + }; } -function it(label:string, test: () => void) { +function it(label: string, test: () => void) { testName = label; test(); } diff --git a/public/docs/_examples/dependency-injection/ts/app/user.service.ts b/public/docs/_examples/dependency-injection/ts/app/user.service.ts index 25e09ecaf8..8fdda925db 100644 --- a/public/docs/_examples/dependency-injection/ts/app/user.service.ts +++ b/public/docs/_examples/dependency-injection/ts/app/user.service.ts @@ -1,10 +1,10 @@ // #docregion -import {Injectable} from '@angular/core'; +import { Injectable } from '@angular/core'; export class User { constructor( - public name:string, - public isAuthorized:boolean = false) { } + public name: string, + public isAuthorized = false) { } } // Todo: get the user; don't 'new' it. diff --git a/public/docs/_examples/displaying-data/ts/app/app-ctor.component.ts b/public/docs/_examples/displaying-data/ts/app/app-ctor.component.ts index ed59b40b2c..d9b816e558 100644 --- a/public/docs/_examples/displaying-data/ts/app/app-ctor.component.ts +++ b/public/docs/_examples/displaying-data/ts/app/app-ctor.component.ts @@ -17,4 +17,4 @@ export class AppCtorComponent { this.myHero = 'Windstorm'; } } -// #enddocregion app-ctor \ No newline at end of file +// #enddocregion app-ctor diff --git a/public/docs/_examples/displaying-data/ts/app/app.component.3.ts b/public/docs/_examples/displaying-data/ts/app/app.component.3.ts index 301343f851..8ea79cce53 100644 --- a/public/docs/_examples/displaying-data/ts/app/app.component.3.ts +++ b/public/docs/_examples/displaying-data/ts/app/app.component.3.ts @@ -1,7 +1,7 @@ // #docregion -import { Component} from '@angular/core'; +import { Component } from '@angular/core'; // #docregion import-hero -import { Hero} from './hero'; +import { Hero } from './hero'; // #enddocregion import-hero @Component({ diff --git a/public/docs/_examples/displaying-data/ts/app/hero.ts b/public/docs/_examples/displaying-data/ts/app/hero.ts index 8b4f06b658..e6b3745186 100644 --- a/public/docs/_examples/displaying-data/ts/app/hero.ts +++ b/public/docs/_examples/displaying-data/ts/app/hero.ts @@ -2,8 +2,8 @@ export class Hero { constructor( // #docregion id-parameter - public id:number, + public id: number, // #enddocregion id-parameter - public name:string) { } + public name: string) { } } -// #enddocregion \ No newline at end of file +// #enddocregion diff --git a/public/docs/_examples/displaying-data/ts/app/main.1.ts b/public/docs/_examples/displaying-data/ts/app/main.1.ts index 2e0a4bc6f4..b033da1575 100644 --- a/public/docs/_examples/displaying-data/ts/app/main.1.ts +++ b/public/docs/_examples/displaying-data/ts/app/main.1.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import { bootstrap } from '@angular/platform-browser-dynamic'; import { AppCtorComponent } from './app-ctor.component'; @@ -8,9 +9,9 @@ import { AppComponent as v3 } from './app.component.3'; import { AppComponent as final } from './app.component'; // pick one -//bootstrap(v1); -//bootstrap(v2); -//bootstrap(v3); +// bootstrap(v1); +// bootstrap(v2); +// bootstrap(v3); bootstrap(final); // for doc testing diff --git a/public/docs/_examples/forms/ts/app/app.component.ts b/public/docs/_examples/forms/ts/app/app.component.ts index b8551a0520..2dcbc8037a 100644 --- a/public/docs/_examples/forms/ts/app/app.component.ts +++ b/public/docs/_examples/forms/ts/app/app.component.ts @@ -1,6 +1,6 @@ // #docregion import { Component } from '@angular/core'; -import { HeroFormComponent } from './hero-form.component' +import { HeroFormComponent } from './hero-form.component'; @Component({ selector: 'my-app', diff --git a/public/docs/_examples/forms/ts/app/hero-form.component.ts b/public/docs/_examples/forms/ts/app/hero-form.component.ts index c4876d8203..7ea7c44738 100644 --- a/public/docs/_examples/forms/ts/app/hero-form.component.ts +++ b/public/docs/_examples/forms/ts/app/hero-form.component.ts @@ -41,7 +41,7 @@ export class HeroFormComponent { this.model = new Hero(42, '', ''); // #enddocregion new-hero-v1 this.active = false; - setTimeout(()=> this.active=true, 0); + setTimeout(() => this.active = true, 0); // #docregion new-hero-v1 } // #enddocregion new-hero-v1 @@ -51,7 +51,7 @@ export class HeroFormComponent { // Reveal in html: // Name via form.controls = {{showFormControls(heroForm)}} - showFormControls(form:NgForm){ + showFormControls(form: NgForm) { return form && form.controls['name'] && // #docregion form-controls diff --git a/public/docs/_examples/hierarchical-dependency-injection/e2e-spec.ts b/public/docs/_examples/hierarchical-dependency-injection/e2e-spec.ts index 1342869429..d3dbf6f392 100644 --- a/public/docs/_examples/hierarchical-dependency-injection/e2e-spec.ts +++ b/public/docs/_examples/hierarchical-dependency-injection/e2e-spec.ts @@ -6,8 +6,8 @@ describe('Hierarchical dependency injection', function () { }); it('should open with a card view', function () { - expect(element.all(by.cssContainingText('button','edit')).get(0).isDisplayed()).toBe(true, - "edit button should be displayed"); + expect(element.all(by.cssContainingText('button', 'edit')).get(0).isDisplayed()).toBe(true, + 'edit button should be displayed'); }); it('should have multiple heroes listed', function () { @@ -15,10 +15,10 @@ describe('Hierarchical dependency injection', function () { }); it('should change to editor view after selection', function () { - let editButtonEle = element.all(by.cssContainingText('button','edit')).get(0); + let editButtonEle = element.all(by.cssContainingText('button', 'edit')).get(0); editButtonEle.click().then(function() { - expect(editButtonEle.isDisplayed()).toBe(false, "edit button should be hidden after selection"); - }) + expect(editButtonEle.isDisplayed()).toBe(false, 'edit button should be hidden after selection'); + }); }); it('should be able to save editor change', function () { @@ -34,11 +34,11 @@ describe('Hierarchical dependency injection', function () { let heroEle = element.all(by.css('heroes-list li')).get(1); // get the 2nd span which is the name of the hero let heroNameEle = heroEle.all(by.css('hero-card span')).get(1); - let editButtonEle = heroEle.element(by.cssContainingText('button','edit')); + let editButtonEle = heroEle.element(by.cssContainingText('button', 'edit')); editButtonEle.click().then(function() { let inputEle = heroEle.element(by.css('hero-editor input')); // return inputEle.sendKeys("foo"); - return sendKeys(inputEle, "foo"); + return sendKeys(inputEle, 'foo'); }).then(function() { let buttonName = shouldSave ? 'save' : 'cancel'; let buttonEle = heroEle.element(by.cssContainingText('button', buttonName)); @@ -49,7 +49,7 @@ describe('Hierarchical dependency injection', function () { } else { expect(heroNameEle.getText()).not.toContain('foo'); } - }) + }); } diff --git a/public/docs/_examples/hierarchical-dependency-injection/ts/app/edit-item.ts b/public/docs/_examples/hierarchical-dependency-injection/ts/app/edit-item.ts index abbeabf2b0..31602112f2 100644 --- a/public/docs/_examples/hierarchical-dependency-injection/ts/app/edit-item.ts +++ b/public/docs/_examples/hierarchical-dependency-injection/ts/app/edit-item.ts @@ -1,6 +1,6 @@ // #docregion export class EditItem { - editing: boolean + editing: boolean; constructor (public item: T) {} } // #docregion diff --git a/public/docs/_examples/hierarchical-dependency-injection/ts/app/heroes.service.ts b/public/docs/_examples/hierarchical-dependency-injection/ts/app/heroes.service.ts index b863ee7af8..2f211e8799 100644 --- a/public/docs/_examples/hierarchical-dependency-injection/ts/app/heroes.service.ts +++ b/public/docs/_examples/hierarchical-dependency-injection/ts/app/heroes.service.ts @@ -2,8 +2,8 @@ import { Hero } from './hero'; export class HeroesService { heroes: Array = [ - { name: "RubberMan", power: 'flexibility'}, - { name: "Tornado", power: 'Weather changer'} + { name: 'RubberMan', power: 'flexibility'}, + { name: 'Tornado', power: 'Weather changer'} ]; getHeroes () { diff --git a/public/docs/_examples/hierarchical-dependency-injection/ts/app/main.ts b/public/docs/_examples/hierarchical-dependency-injection/ts/app/main.ts index 5a96ae391b..d24e5a3274 100644 --- a/public/docs/_examples/hierarchical-dependency-injection/ts/app/main.ts +++ b/public/docs/_examples/hierarchical-dependency-injection/ts/app/main.ts @@ -4,7 +4,7 @@ import { bootstrap } from '@angular/platform-browser-dynamic'; import { HeroesListComponent } from './heroes-list.component'; import { HeroesService } from './heroes.service'; -bootstrap(HeroesListComponent, [HeroesService]) +bootstrap(HeroesListComponent, [HeroesService]); /* Documentation artifact below // #docregion bad-alternative diff --git a/public/docs/_examples/hierarchical-dependency-injection/ts/app/restore.service.ts b/public/docs/_examples/hierarchical-dependency-injection/ts/app/restore.service.ts index c81786b2a3..667b8a053d 100644 --- a/public/docs/_examples/hierarchical-dependency-injection/ts/app/restore.service.ts +++ b/public/docs/_examples/hierarchical-dependency-injection/ts/app/restore.service.ts @@ -8,16 +8,16 @@ export class RestoreService { this.currentItem = this.clone(item); } - getItem () :T { + getItem (): T { return this.currentItem; } - restoreItem () :T { + restoreItem (): T { this.currentItem = this.originalItem; return this.getItem(); } - clone (item: T) :T { + clone (item: T): T { // super poor clone implementation return JSON.parse(JSON.stringify(item)); } diff --git a/public/docs/_examples/homepage-hello-world/e2e-spec.ts b/public/docs/_examples/homepage-hello-world/e2e-spec.ts index 4200429a4f..260a111ec5 100644 --- a/public/docs/_examples/homepage-hello-world/e2e-spec.ts +++ b/public/docs/_examples/homepage-hello-world/e2e-spec.ts @@ -10,7 +10,7 @@ describe('Homepage Hello World', function () { it(`should display the label: ${expectedLabel}`, function () { expect(element(by.css('label')).getText()).toEqual(expectedLabel); }); - + it('should display entered name', function () { let testName = 'Bobby Joe'; let nameEle = element.all(by.css('input')).get(0); diff --git a/public/docs/_examples/homepage-todo/ts/app/todo.ts b/public/docs/_examples/homepage-todo/ts/app/todo.ts index 57070dc72c..35faec9705 100644 --- a/public/docs/_examples/homepage-todo/ts/app/todo.ts +++ b/public/docs/_examples/homepage-todo/ts/app/todo.ts @@ -1,6 +1,6 @@ // #docregion // Declare an interaface for type safety export interface Todo { - text: string, - done: boolean + text: string; + done: boolean; } diff --git a/public/docs/_examples/homepage-todo/ts/app/todo_app.ts b/public/docs/_examples/homepage-todo/ts/app/todo_app.ts index 96cb759eeb..aa85c13089 100644 --- a/public/docs/_examples/homepage-todo/ts/app/todo_app.ts +++ b/public/docs/_examples/homepage-todo/ts/app/todo_app.ts @@ -14,7 +14,7 @@ import { TodoForm } from './todo_form'; `, - styles:['a { cursor: pointer; cursor: hand; }'], + styles: ['a { cursor: pointer; cursor: hand; }'], directives: [TodoList, TodoForm] }) export class TodoApp { diff --git a/public/docs/_examples/homepage-todo/ts/app/todo_form.ts b/public/docs/_examples/homepage-todo/ts/app/todo_form.ts index ecc8596772..98d32a6ef9 100644 --- a/public/docs/_examples/homepage-todo/ts/app/todo_form.ts +++ b/public/docs/_examples/homepage-todo/ts/app/todo_form.ts @@ -17,7 +17,7 @@ export class TodoForm { addTodo() { if (this.task) { - this.newTask.next({text:this.task, done:false}); + this.newTask.next({text: this.task, done: false}); } this.task = ''; } diff --git a/public/docs/_examples/homepage-todo/ts/app/todo_list.ts b/public/docs/_examples/homepage-todo/ts/app/todo_list.ts index bdeff74a27..8738437429 100644 --- a/public/docs/_examples/homepage-todo/ts/app/todo_list.ts +++ b/public/docs/_examples/homepage-todo/ts/app/todo_list.ts @@ -1,5 +1,6 @@ // #docregion import { Component, Input } from '@angular/core'; + import { Todo } from './todo'; @Component({ diff --git a/public/docs/_examples/lifecycle-hooks/e2e-spec.ts b/public/docs/_examples/lifecycle-hooks/e2e-spec.ts index 763fb3e5a0..ec6f5a5b4b 100644 --- a/public/docs/_examples/lifecycle-hooks/e2e-spec.ts +++ b/public/docs/_examples/lifecycle-hooks/e2e-spec.ts @@ -11,22 +11,22 @@ describe('Lifecycle hooks', function () { it('should support peek-a-boo', function () { let pabComp = element(by.css('peek-a-boo-parent peek-a-boo')); - expect(pabComp.isPresent()).toBe(false, "should not be able to find the 'peek-a-boo' component"); + expect(pabComp.isPresent()).toBe(false, 'should not be able to find the "peek-a-boo" component'); let pabButton = element.all(by.css('peek-a-boo-parent button')).get(0); let updateHeroButton = element.all(by.css('peek-a-boo-parent button')).get(1); expect(pabButton.getText()).toContain('Create Peek'); pabButton.click().then(function () { expect(pabButton.getText()).toContain('Destroy Peek'); - expect(pabComp.isDisplayed()).toBe(true, "should be able to see the 'peek-a-boo' component"); + expect(pabComp.isDisplayed()).toBe(true, 'should be able to see the "peek-a-boo" component'); expect(pabComp.getText()).toContain('Windstorm'); expect(pabComp.getText()).not.toContain('Windstorm!'); - expect(updateHeroButton.isPresent()).toBe(true, "should be able to see the update hero button"); + expect(updateHeroButton.isPresent()).toBe(true, 'should be able to see the update hero button'); return updateHeroButton.click(); }).then(function () { expect(pabComp.getText()).toContain('Windstorm!'); return pabButton.click(); }).then(function () { - expect(pabComp.isPresent()).toBe(false, "should no longer be able to find the 'peek-a-boo' component"); + expect(pabComp.isPresent()).toBe(false, 'should no longer be able to find the "peek-a-boo" component'); }); }); @@ -39,18 +39,18 @@ describe('Lifecycle hooks', function () { let changeLogEles = onChangesViewEle.all(by.css('div')); expect(titleEle.getText()).toContain('Windstorm can sing'); - expect(changeLogEles.count()).toEqual(2, "should start with 2 messages"); + expect(changeLogEles.count()).toEqual(2, 'should start with 2 messages'); // heroNameInputEle.sendKeys('-foo-').then(function () { sendKeys(heroNameInputEle, '-foo-').then(function () { expect(titleEle.getText()).toContain('Windstorm-foo- can sing'); - expect(changeLogEles.count()).toEqual(2, "should still have 2 messages"); + expect(changeLogEles.count()).toEqual(2, 'should still have 2 messages'); // protractor bug with sendKeys means that line below does not work. // return powerInputEle.sendKeys('-bar-'); return sendKeys(powerInputEle, '-bar-'); }).then(function () { expect(titleEle.getText()).toContain('Windstorm-foo- can sing-bar-'); // 7 == 2 previously + length of '-bar-' - expect(changeLogEles.count()).toEqual(7, "should have 7 messages now"); + expect(changeLogEles.count()).toEqual(7, 'should have 7 messages now'); }); }); @@ -66,16 +66,16 @@ describe('Lifecycle hooks', function () { expect(titleEle.getText()).toContain('Windstorm can sing'); changeLogEles.count().then(function(count) { // Empirically 5 messages to start - expect(count).toBeGreaterThan(4, "should start with some messages"); + expect(count).toBeGreaterThan(4, 'should start with some messages'); logCount = count; // heroNameInputEle.sendKeys('-foo-').then(function () { - return sendKeys(heroNameInputEle, '-foo-') + return sendKeys(heroNameInputEle, '-foo-'); }).then(function () { expect(titleEle.getText()).toContain('Windstorm-foo- can sing'); - return changeLogEles.count() + return changeLogEles.count(); }).then(function (count) { // two more for each keystroke except the 1st - expect(count).toEqual(logCount + 9, 'should add 9 more messages') + expect(count).toEqual(logCount + 9, 'should add 9 more messages'); logCount = count; // return powerInputEle.sendKeys('-bar-'); return sendKeys(powerInputEle, '-bar-'); @@ -99,18 +99,18 @@ describe('Lifecycle hooks', function () { logEles.count().then(function(count) { logCount = count; - return sendKeys(childViewInputEle, "-test-"); + return sendKeys(childViewInputEle, '-test-'); }).then(function() { expect(childViewInputEle.getAttribute('value')).toContain('-test-'); - expect(commentEle.isPresent()).toBe(true,'should have comment because >10 chars'); + expect(commentEle.isPresent()).toBe(true, 'should have comment because >10 chars'); expect(commentEle.getText()).toContain('long name'); return logEles.count(); }).then(function(count) { - expect(logCount + 10).toEqual(count, "10 additional log messages should have been added"); + expect(logCount + 10).toEqual(count, '10 additional log messages should have been added'); logCount = count; return buttonEle.click(); }).then(function() { - expect(logEles.count()).toBeLessThan(logCount, "log should shrink after reset"); + expect(logEles.count()).toBeLessThan(logCount, 'log should shrink after reset'); }); }); @@ -128,30 +128,30 @@ describe('Lifecycle hooks', function () { logEles.count().then(function(count) { logCount = count; - return sendKeys(childViewInputEle, "-test-"); + return sendKeys(childViewInputEle, '-test-'); }).then(function() { expect(childViewInputEle.getAttribute('value')).toContain('-test-'); - expect(commentEle.isPresent()).toBe(true,'should have comment because >10 chars'); + expect(commentEle.isPresent()).toBe(true, 'should have comment because >10 chars'); expect(commentEle.getText()).toContain('long name'); return logEles.count(); }).then(function(count) { - expect(logCount + 10).toEqual(count, "10 additional log messages should have been added"); + expect(logCount + 10).toEqual(count, '10 additional log messages should have been added'); logCount = count; return buttonEle.click(); }).then(function() { - expect(logEles.count()).toBeLessThan(logCount, "log should shrink after reset"); + expect(logEles.count()).toBeLessThan(logCount, 'log should shrink after reset'); }); }); it('should support spy\'s OnInit & OnDestroy hooks', function () { let inputEle = element(by.css('spy-parent input')); - let addHeroButtonEle = element(by.cssContainingText('spy-parent button','Add Hero')); - let resetHeroesButtonEle = element(by.cssContainingText('spy-parent button','Reset Heroes')); + let addHeroButtonEle = element(by.cssContainingText('spy-parent button', 'Add Hero')); + let resetHeroesButtonEle = element(by.cssContainingText('spy-parent button', 'Reset Heroes')); let heroEles = element.all(by.css('spy-parent div[mySpy')); let logEles = element.all(by.css('spy-parent h4 ~ div')); expect(heroEles.count()).toBe(2, 'should have two heroes displayed'); expect(logEles.count()).toBe(2, 'should have two log entries'); - sendKeys(inputEle, "-test-").then(function() { + sendKeys(inputEle, '-test-').then(function() { return addHeroButtonEle.click(); }).then(function() { expect(heroEles.count()).toBe(3, 'should have added one hero'); @@ -161,12 +161,12 @@ describe('Lifecycle hooks', function () { }).then(function() { expect(heroEles.count()).toBe(0, 'should no longer have any heroes'); expect(logEles.count()).toBe(7, 'should now have 7 log entries - 3 orig + 1 reset + 3 removeall'); - }) + }); }); it('should support "spy counter"', function () { - let updateCounterButtonEle = element(by.cssContainingText('counter-parent button','Update')); - let resetCounterButtonEle = element(by.cssContainingText('counter-parent button','Reset')); + let updateCounterButtonEle = element(by.cssContainingText('counter-parent button', 'Update')); + let resetCounterButtonEle = element(by.cssContainingText('counter-parent button', 'Reset')); let textEle = element(by.css('counter-parent my-counter > div')); let logEles = element.all(by.css('counter-parent h4 ~ div')); expect(textEle.getText()).toContain('Counter = 0'); @@ -178,8 +178,6 @@ describe('Lifecycle hooks', function () { }).then(function() { expect(textEle.getText()).toContain('Counter = 0'); expect(logEles.count()).toBe(7, 'should now have 7 log entries - 3 prev + 1 reset + 2 destroy + 1 init'); - }) + }); }); - - }); diff --git a/public/docs/_examples/lifecycle-hooks/ts/app/after-content.component.ts b/public/docs/_examples/lifecycle-hooks/ts/app/after-content.component.ts index 6d970f8aa0..279a609ed3 100644 --- a/public/docs/_examples/lifecycle-hooks/ts/app/after-content.component.ts +++ b/public/docs/_examples/lifecycle-hooks/ts/app/after-content.component.ts @@ -2,7 +2,7 @@ // #docregion import { AfterContentChecked, AfterContentInit, Component, ContentChild } from '@angular/core'; -import {LoggerService} from './logger.service'; +import { LoggerService } from './logger.service'; ////////////////// @Component({ @@ -63,7 +63,7 @@ export class AfterContentComponent implements AfterContentChecked, AfterContentI // This surrogate for real business logic sets the `comment` private doSomething() { - this.comment = this.contentChild.hero.length > 10 ? 'That\'s a long name' : ''; + this.comment = this.contentChild.hero.length > 10 ? `That's a long name` : ''; } private logIt(method: string) { diff --git a/public/docs/_examples/lifecycle-hooks/ts/app/after-view.component.ts b/public/docs/_examples/lifecycle-hooks/ts/app/after-view.component.ts index 800a43fcc3..000cf348eb 100644 --- a/public/docs/_examples/lifecycle-hooks/ts/app/after-view.component.ts +++ b/public/docs/_examples/lifecycle-hooks/ts/app/after-view.component.ts @@ -2,7 +2,7 @@ // #docregion import { AfterViewChecked, AfterViewInit, Component, ViewChild } from '@angular/core'; -import {LoggerService} from './logger.service'; +import { LoggerService } from './logger.service'; ////////////////// // #docregion child-view @@ -39,7 +39,7 @@ export class AfterViewComponent implements AfterViewChecked, AfterViewInit { @ViewChild(ChildViewComponent) viewChild: ChildViewComponent; // #enddocregion hooks - constructor(private logger:LoggerService){ + constructor(private logger: LoggerService) { this.logIt('AfterView constructor'); } @@ -67,7 +67,7 @@ export class AfterViewComponent implements AfterViewChecked, AfterViewInit { // #docregion do-something // This surrogate for real business logic sets the `comment` private doSomething() { - let c = this.viewChild.hero.length > 10 ? "That's a long name" : ''; + let c = this.viewChild.hero.length > 10 ? `That's a long name` : ''; if (c !== this.comment) { // Wait a tick because the component's view has already been checked this.logger.tick_then(() => this.comment = c); @@ -75,9 +75,9 @@ export class AfterViewComponent implements AfterViewChecked, AfterViewInit { } // #enddocregion do-something - private logIt(method:string){ + private logIt(method: string) { let child = this.viewChild; - let message = `${method}: ${child ? child.hero:'no'} child view` + let message = `${method}: ${child ? child.hero : 'no'} child view`; this.logger.log(message); } // #docregion hooks @@ -100,11 +100,11 @@ export class AfterViewComponent implements AfterViewChecked, AfterViewInit { `, styles: ['.parent {background: burlywood}'], - providers:[LoggerService], + providers: [LoggerService], directives: [AfterViewComponent] }) export class AfterViewParentComponent { - logs:string[]; + logs: string[]; show = true; constructor(private logger: LoggerService) { @@ -112,7 +112,7 @@ export class AfterViewParentComponent { } reset() { - this.logs.length=0; + this.logs.length = 0; // quickly remove and reload AfterViewComponent which recreates it this.show = false; this.logger.tick_then(() => this.show = true); diff --git a/public/docs/_examples/lifecycle-hooks/ts/app/peek-a-boo.component.ts b/public/docs/_examples/lifecycle-hooks/ts/app/peek-a-boo.component.ts index 1485f2992a..c17bf24082 100644 --- a/public/docs/_examples/lifecycle-hooks/ts/app/peek-a-boo.component.ts +++ b/public/docs/_examples/lifecycle-hooks/ts/app/peek-a-boo.component.ts @@ -9,8 +9,8 @@ import { OnInit, SimpleChange } from '@angular/core'; -import {Component, Input} from '@angular/core'; -import {LoggerService} from './logger.service'; +import { Component, Input } from '@angular/core'; +import { LoggerService } from './logger.service'; let nextId = 1; diff --git a/public/docs/_examples/lifecycle-hooks/ts/app/spy.directive.ts b/public/docs/_examples/lifecycle-hooks/ts/app/spy.directive.ts index ba7582ea50..6119771c60 100644 --- a/public/docs/_examples/lifecycle-hooks/ts/app/spy.directive.ts +++ b/public/docs/_examples/lifecycle-hooks/ts/app/spy.directive.ts @@ -1,7 +1,7 @@ // #docregion -import {Directive, OnInit, OnDestroy} from '@angular/core'; +import { Directive, OnInit, OnDestroy } from '@angular/core'; -import {LoggerService} from './logger.service'; +import { LoggerService } from './logger.service'; let nextId = 1; diff --git a/public/docs/_examples/pipes/e2e-spec.ts b/public/docs/_examples/pipes/e2e-spec.ts index 9b626d48bb..2e2d3448af 100644 --- a/public/docs/_examples/pipes/e2e-spec.ts +++ b/public/docs/_examples/pipes/e2e-spec.ts @@ -7,7 +7,7 @@ describe('Pipes', function () { it('should open correctly', function () { expect(element.all(by.tagName('h1')).get(0).getText()).toEqual('Pipes'); - expect(element(by.css('hero-birthday p')).getText()).toEqual("The hero's birthday is Apr 15, 1988"); + expect(element(by.css('hero-birthday p')).getText()).toEqual(`The hero's birthday is Apr 15, 1988`); }); it('should show 4 heroes', function () { @@ -19,23 +19,23 @@ describe('Pipes', function () { }); it('should show alternate birthday formats', function () { - expect(element(by.cssContainingText('my-app > p', "The hero's birthday is Apr 15, 1988")).isDisplayed()).toBe(true); - expect(element(by.cssContainingText('my-app > p', "The hero's birthday is 04/15/88")).isDisplayed()).toBe(true); + expect(element(by.cssContainingText('my-app > p', `The hero's birthday is Apr 15, 1988`)).isDisplayed()).toBe(true); + expect(element(by.cssContainingText('my-app > p', `The hero's birthday is 04/15/88`)).isDisplayed()).toBe(true); }); it('should be able to toggle birthday formats', function () { let birthDayEle = element(by.css('hero-birthday2 > p')); - expect(birthDayEle.getText()).toEqual("The hero's birthday is 4/15/1988"); - let buttonEle = element(by.cssContainingText('hero-birthday2 > button', "Toggle Format")); + expect(birthDayEle.getText()).toEqual(`The hero's birthday is 4/15/1988`); + let buttonEle = element(by.cssContainingText('hero-birthday2 > button', 'Toggle Format')); expect(buttonEle.isDisplayed()).toBe(true); buttonEle.click().then(function() { - expect(birthDayEle.getText()).toEqual("The hero's birthday is Friday, April 15, 1988"); + expect(birthDayEle.getText()).toEqual(`The hero's birthday is Friday, April 15, 1988`); }); }); it('should be able to chain and compose pipes', function () { - let chainedPipeEles = element.all(by.cssContainingText('my-app p', "The chained hero's")); - expect(chainedPipeEles.count()).toBe(3, "should have 3 chained pipe examples"); + let chainedPipeEles = element.all(by.cssContainingText('my-app p', `The chained hero's`)); + expect(chainedPipeEles.count()).toBe(3, 'should have 3 chained pipe examples'); expect(chainedPipeEles.get(0).getText()).toContain('APR 15, 1988'); expect(chainedPipeEles.get(1).getText()).toContain('FRIDAY, APRIL 15, 1988'); expect(chainedPipeEles.get(2).getText()).toContain('FRIDAY, APRIL 15, 1988'); @@ -52,13 +52,13 @@ describe('Pipes', function () { let factorInputEle = eles.get(1); let outputEle = element(by.css('power-boost-calculator p')); baseInputEle.clear().then(function() { - return sendKeys(baseInputEle, "7"); + return sendKeys(baseInputEle, '7'); }).then(function() { return factorInputEle.clear(); }).then(function() { - return sendKeys(factorInputEle, "3"); + return sendKeys(factorInputEle, '3'); }).then(function() { - expect(outputEle.getText()).toContain("343"); + expect(outputEle.getText()).toContain('343'); }); }); @@ -73,14 +73,14 @@ describe('Pipes', function () { expect(canFlyCheckEle.getAttribute('checked')).toEqual('true', 'should default to "can fly"'); expect(mutateCheckEle.getAttribute('checked')).toEqual('true', 'should default to mutating array'); expect(flyingHeroesEle.count()).toEqual(2, 'only two of the original heroes can fly'); - - return sendKeys(nameEle, "test1\n") + + return sendKeys(nameEle, 'test1\n') .then(function(){ expect(flyingHeroesEle.count()).toEqual(2, 'no change while mutating array'); return mutateCheckEle.click(); }) .then(function() { - return sendKeys(nameEle, "test2\n"); + return sendKeys(nameEle, 'test2\n'); }) .then(function() { expect(flyingHeroesEle.count()).toEqual(4, 'not mutating; should see both adds'); @@ -90,25 +90,24 @@ describe('Pipes', function () { }) .then(function() { expect(flyingHeroesEle.count()).toEqual(2, 'reset should restore orginal flying heroes'); - }) + }); }); - - + + it('should support flying heroes (impure) ', function () { let nameEle = element(by.css('flying-heroes-impure input[type="text"]')); - let canFlyCheckEle = element(by.css('flying-heroes-impure #can-fly')); + let canFlyCheckEle = element(by.css('flying-heroes-impure #can-fly')); let mutateCheckEle = element(by.css('flying-heroes-impure #mutate')); - let resetEle = element(by.css('flying-heroes-impure button')); let flyingHeroesEle = element.all(by.css('flying-heroes-impure #flyers div')); expect(canFlyCheckEle.getAttribute('checked')).toEqual('true', 'should default to "can fly"'); expect(mutateCheckEle.getAttribute('checked')).toEqual('true', 'should default to mutating array'); expect(flyingHeroesEle.count()).toEqual(2, 'only two of the original heroes can fly'); - - return sendKeys(nameEle, "test1\n") + + return sendKeys(nameEle, 'test1\n') .then(function(){ expect(flyingHeroesEle.count()).toEqual(3, 'new flying hero should show in mutating array'); - }) + }); }); it('should show an async hero message', function () { diff --git a/public/docs/_examples/pipes/ts/app/app.component.ts b/public/docs/_examples/pipes/ts/app/app.component.ts index c79c1305df..c00656f4ea 100644 --- a/public/docs/_examples/pipes/ts/app/app.component.ts +++ b/public/docs/_examples/pipes/ts/app/app.component.ts @@ -14,7 +14,7 @@ import { PowerBoostCalculator } from './power-boost-calculator.component'; @Component({ selector: 'my-app', templateUrl: 'app/app.component.html', - directives:[ + directives: [ FlyingHeroesComponent, FlyingHeroesImpureComponent, HeroAsyncMessageComponent, HeroBirthday, @@ -22,8 +22,8 @@ import { PowerBoostCalculator } from './power-boost-calculator.component'; HeroListComponent, PowerBooster, PowerBoostCalculator ], - providers:[HTTP_PROVIDERS] + providers: [HTTP_PROVIDERS] }) export class AppComponent { - birthday = new Date(1988,3,15); // April 15, 1988 + birthday = new Date(1988, 3, 15); // April 15, 1988 } diff --git a/public/docs/_examples/pipes/ts/app/fetch-json.pipe.ts b/public/docs/_examples/pipes/ts/app/fetch-json.pipe.ts index 72fd58e178..003858c0b6 100644 --- a/public/docs/_examples/pipes/ts/app/fetch-json.pipe.ts +++ b/public/docs/_examples/pipes/ts/app/fetch-json.pipe.ts @@ -8,7 +8,7 @@ import { Http } from '@angular/http'; pure: false }) // #enddocregion pipe-metadata -export class FetchJsonPipe implements PipeTransform{ +export class FetchJsonPipe implements PipeTransform { private fetchedJson: any = null; private prevUrl = ''; diff --git a/public/docs/_examples/pipes/ts/app/flying-heroes.component.ts b/public/docs/_examples/pipes/ts/app/flying-heroes.component.ts index 94323297ba..d7bc01f94f 100644 --- a/public/docs/_examples/pipes/ts/app/flying-heroes.component.ts +++ b/public/docs/_examples/pipes/ts/app/flying-heroes.component.ts @@ -14,7 +14,7 @@ import { HEROES } from './heroes'; }) // #docregion v1 export class FlyingHeroesComponent { - heroes:any[] = []; + heroes: any[] = []; canFly = true; // #enddocregion v1 mutate = true; @@ -23,7 +23,7 @@ export class FlyingHeroesComponent { // #docregion v1 constructor() { this.reset(); } - addHero(name:string) { + addHero(name: string) { name = name.trim(); if (!name) { return; } let hero = {name, canFly: this.canFly}; @@ -33,7 +33,7 @@ export class FlyingHeroesComponent { // Impure pipe will display // #docregion v1 // #docregion push - this.heroes.push(hero) + this.heroes.push(hero); // #enddocregion push // #enddocregion v1 } else { diff --git a/public/docs/_examples/pipes/ts/app/flying-heroes.pipe.ts b/public/docs/_examples/pipes/ts/app/flying-heroes.pipe.ts index 3dee7d6757..eb9b0f172a 100644 --- a/public/docs/_examples/pipes/ts/app/flying-heroes.pipe.ts +++ b/public/docs/_examples/pipes/ts/app/flying-heroes.pipe.ts @@ -6,7 +6,7 @@ import { Flyer } from './heroes'; @Pipe({ name: 'flyingHeroes' }) export class FlyingHeroesPipe implements PipeTransform { - transform(allHeroes:Flyer[]) { + transform(allHeroes: Flyer[]) { // #docregion filter return allHeroes.filter(hero => hero.canFly); // #enddocregion filter diff --git a/public/docs/_examples/pipes/ts/app/hero-async-message.component.ts b/public/docs/_examples/pipes/ts/app/hero-async-message.component.ts index cced9f3e57..4e36ddd0cb 100644 --- a/public/docs/_examples/pipes/ts/app/hero-async-message.component.ts +++ b/public/docs/_examples/pipes/ts/app/hero-async-message.component.ts @@ -10,7 +10,13 @@ import { Observable } from 'rxjs/Rx'; `, }) export class HeroAsyncMessageComponent { - message$:Observable; + message$: Observable; + + private messages = [ + 'You are my hero!', + 'You are the best hero!', + 'Will you be my hero?' + ]; constructor() { this.resend(); } @@ -19,12 +25,6 @@ export class HeroAsyncMessageComponent { .map(i => this.messages[i]) .take(this.messages.length); } - - private messages = [ - 'You are my hero!', - 'You are the best hero!', - 'Will you be my hero?' - ]; } // #enddocregion diff --git a/public/docs/_examples/pipes/ts/app/hero-birthday1.component.ts b/public/docs/_examples/pipes/ts/app/hero-birthday1.component.ts index 52a462757b..1759ccd43e 100644 --- a/public/docs/_examples/pipes/ts/app/hero-birthday1.component.ts +++ b/public/docs/_examples/pipes/ts/app/hero-birthday1.component.ts @@ -1,5 +1,5 @@ // #docregion -import { Component } from '@angular/core' +import { Component } from '@angular/core'; @Component({ selector: 'hero-birthday', @@ -8,5 +8,5 @@ import { Component } from '@angular/core' // #enddocregion hero-birthday-template }) export class HeroBirthday { - birthday = new Date(1988,3,15); // April 15, 1988 + birthday = new Date(1988, 3, 15); // April 15, 1988 } diff --git a/public/docs/_examples/pipes/ts/app/hero-birthday2.component.ts b/public/docs/_examples/pipes/ts/app/hero-birthday2.component.ts index 683f082e27..7a0d016fe7 100644 --- a/public/docs/_examples/pipes/ts/app/hero-birthday2.component.ts +++ b/public/docs/_examples/pipes/ts/app/hero-birthday2.component.ts @@ -1,5 +1,5 @@ // #docregion -import { Component } from '@angular/core' +import { Component } from '@angular/core'; @Component({ selector: 'hero-birthday2', @@ -12,9 +12,9 @@ import { Component } from '@angular/core' }) // #docregion class export class HeroBirthday2 { - birthday = new Date(1988,3,15); // April 15, 1988 + birthday = new Date(1988, 3, 15); // April 15, 1988 toggle = true; // start with true == shortDate - get format() { return this.toggle ? 'shortDate' : 'fullDate'} + get format() { return this.toggle ? 'shortDate' : 'fullDate'; } toggleFormat() { this.toggle = !this.toggle; } } diff --git a/public/docs/_examples/pipes/ts/app/heroes.ts b/public/docs/_examples/pipes/ts/app/heroes.ts index fe30ad84f4..b2edabe0da 100644 --- a/public/docs/_examples/pipes/ts/app/heroes.ts +++ b/public/docs/_examples/pipes/ts/app/heroes.ts @@ -1,7 +1,7 @@ -export interface Flyer { canFly: boolean } +export interface Flyer { canFly: boolean; } export const HEROES = [ - {"name": "Windstorm", "canFly": true}, - {"name": "Bombasto", "canFly": false}, - {"name": "Magneto", "canFly": false}, - {"name": "Tornado", "canFly": true} -]; \ No newline at end of file + {name: 'Windstorm', canFly: true}, + {name: 'Bombasto', canFly: false}, + {name: 'Magneto', canFly: false}, + {name: 'Tornado', canFly: true} +]; diff --git a/public/docs/_examples/router-deprecated/e2e-spec.ts b/public/docs/_examples/router-deprecated/e2e-spec.ts index 85b0598df5..961f5f7f50 100644 --- a/public/docs/_examples/router-deprecated/e2e-spec.ts +++ b/public/docs/_examples/router-deprecated/e2e-spec.ts @@ -23,36 +23,36 @@ describe('Router', function () { heroDetail: element(by.css('my-app > undefined > div')), heroDetailTitle: element(by.css('my-app > undefined > div > h3')), - } + }; } it('should be able to see the start screen', function () { let page = getPageStruct(); expect(page.hrefs.count()).toEqual(2, 'should be two dashboard choices'); - expect(page.crisisHref.getText()).toEqual("Crisis Center"); - expect(page.heroesHref.getText()).toEqual("Heroes"); + expect(page.crisisHref.getText()).toEqual('Crisis Center'); + expect(page.heroesHref.getText()).toEqual('Heroes'); }); it('should be able to see crises center items', function () { let page = getPageStruct(); - expect(page.crisisList.count()).toBe(4, "should be 4 crisis center entries at start"); + expect(page.crisisList.count()).toBe(4, 'should be 4 crisis center entries at start'); }); it('should be able to see hero items', function () { let page = getPageStruct(); page.heroesHref.click().then(function() { expect(page.routerTitle.getText()).toContain('HEROES'); - expect(page.heroesList.count()).toBe(6, "should be 6 heroes"); + expect(page.heroesList.count()).toBe(6, 'should be 6 heroes'); }); }); it('should be able to toggle the views', function () { let page = getPageStruct(); page.crisisHref.click().then(function() { - expect(page.crisisList.count()).toBe(4, "should be 4 crisis center entries"); + expect(page.crisisList.count()).toBe(4, 'should be 4 crisis center entries'); return page.heroesHref.click(); }).then(function() { - expect(page.heroesList.count()).toBe(6, "should be 6 heroes"); + expect(page.heroesList.count()).toBe(6, 'should be 6 heroes'); }); }); @@ -77,7 +77,7 @@ describe('Router', function () { heroText = text.substr(text.indexOf(' ')).trim(); return heroEle.click(); }).then(function() { - expect(page.heroesList.count()).toBe(0, "should no longer see crisis center entries"); + expect(page.heroesList.count()).toBe(0, 'should no longer see crisis center entries'); expect(page.heroDetail.isPresent()).toBe(true, 'should be able to see crisis detail'); expect(page.heroDetailTitle.getText()).toContain(heroText); let inputEle = page.heroDetail.element(by.css('input')); @@ -88,7 +88,7 @@ describe('Router', function () { return buttonEle.click(); }).then(function() { expect(heroEle.getText()).toContain(heroText + '-foo'); - }) + }); }); function crisisCenterEdit(index: number, shouldSave: boolean) { @@ -105,7 +105,7 @@ describe('Router', function () { crisisText = text.substr(text.indexOf(' ')).trim(); return crisisEle.click(); }).then(function () { - expect(page.crisisList.count()).toBe(0, "should no longer see crisis center entries"); + expect(page.crisisList.count()).toBe(0, 'should no longer see crisis center entries'); expect(page.crisisDetail.isPresent()).toBe(true, 'should be able to see crisis detail'); expect(page.crisisDetailTitle.getText()).toContain(crisisText); let inputEle = page.crisisDetail.element(by.css('input')); diff --git a/public/docs/_examples/router-deprecated/ts/app/crisis-center/add-crisis.component.ts b/public/docs/_examples/router-deprecated/ts/app/crisis-center/add-crisis.component.ts index 5067e8aa3f..f5e820ca6f 100644 --- a/public/docs/_examples/router-deprecated/ts/app/crisis-center/add-crisis.component.ts +++ b/public/docs/_examples/router-deprecated/ts/app/crisis-center/add-crisis.component.ts @@ -39,4 +39,4 @@ export class AddCrisisComponent implements CanDeactivate { gotoCrises() { this.router.navigate(['CrisisCenter']); } -} \ No newline at end of file +} diff --git a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-center.component.1.ts b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-center.component.1.ts index 496b8ba11e..6925fb8008 100644 --- a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-center.component.1.ts +++ b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-center.component.1.ts @@ -19,9 +19,9 @@ import { CrisisService } from './crisis.service'; // #docregion route-config @RouteConfig([ // #docregion default-route - {path:'/', name: 'CrisisList', component: CrisisListComponent, useAsDefault: true}, + {path: '/', name: 'CrisisList', component: CrisisListComponent, useAsDefault: true}, // #enddocregion default-route - {path:'/:id', name: 'CrisisDetail', component: CrisisDetailComponent} + {path: '/:id', name: 'CrisisDetail', component: CrisisDetailComponent} ]) // #enddocregion route-config export class CrisisCenterComponent { } diff --git a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-center.component.ts b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-center.component.ts index 27f9ff09ac..3c735ae6ae 100644 --- a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-center.component.ts +++ b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-center.component.ts @@ -15,8 +15,8 @@ import { CrisisService } from './crisis.service'; providers: [CrisisService] }) @RouteConfig([ - {path:'/', name: 'CrisisList', component: CrisisListComponent, useAsDefault: true}, - {path:'/:id', name: 'CrisisDetail', component: CrisisDetailComponent} + {path: '/', name: 'CrisisList', component: CrisisListComponent, useAsDefault: true}, + {path: '/:id', name: 'CrisisDetail', component: CrisisDetailComponent} ]) export class CrisisCenterComponent { } // #enddocregion diff --git a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-detail.component.1.ts b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-detail.component.1.ts index 8fb93b371a..0c683853c9 100644 --- a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-detail.component.1.ts +++ b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-detail.component.1.ts @@ -60,7 +60,7 @@ export class CrisisDetailComponent implements OnInit, CanDeactivate { // #enddocregion ngOnInit // #docregion routerCanDeactivate - routerCanDeactivate(next: ComponentInstruction, prev: ComponentInstruction) : any { + routerCanDeactivate(next: ComponentInstruction, prev: ComponentInstruction): any { // Allow synchronous navigation (`true`) if no crisis or the crisis is unchanged. if (!this.crisis || this.crisis.name === this.editName) { return true; diff --git a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-detail.component.ts b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-detail.component.ts index aa90528a8a..143f0f061a 100644 --- a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-detail.component.ts +++ b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis-detail.component.ts @@ -51,7 +51,7 @@ export class CrisisDetailComponent implements OnInit, CanDeactivate { }); } - routerCanDeactivate(next: ComponentInstruction, prev: ComponentInstruction) : any { + routerCanDeactivate(next: ComponentInstruction, prev: ComponentInstruction): any { // Allow synchronous navigation (`true`) if no crisis or the crisis is unchanged. if (!this.crisis || this.crisis.name === this.editName) { return true; diff --git a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis.service.ts b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis.service.ts index 949ccd4e00..da67b9e3f4 100644 --- a/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis.service.ts +++ b/public/docs/_examples/router-deprecated/ts/app/crisis-center/crisis.service.ts @@ -1,5 +1,4 @@ // #docplaster - // #docregion import { Injectable } from '@angular/core'; @@ -20,9 +19,9 @@ export class CrisisService { static nextCrisisId = 100; - addCrisis(name:string) { + addCrisis(name: string) { name = name.trim(); - if (name){ + if (name) { let crisis = new Crisis(CrisisService.nextCrisisId++, name); crisesPromise.then(crises => crises.push(crisis)); } @@ -30,12 +29,12 @@ export class CrisisService { // #docregion } -var crises = [ +let crises = [ new Crisis(1, 'Dragon Burning Cities'), new Crisis(2, 'Sky Rains Great White Sharks'), new Crisis(3, 'Giant Asteroid Heading For Earth'), new Crisis(4, 'Procrastinators Meeting Delayed Again'), ]; -var crisesPromise = Promise.resolve(crises); +let crisesPromise = Promise.resolve(crises); // #enddocregion diff --git a/public/docs/_examples/router-deprecated/ts/app/dialog.service.ts b/public/docs/_examples/router-deprecated/ts/app/dialog.service.ts index 3f5ceba475..71a342cbe8 100644 --- a/public/docs/_examples/router-deprecated/ts/app/dialog.service.ts +++ b/public/docs/_examples/router-deprecated/ts/app/dialog.service.ts @@ -11,7 +11,7 @@ export class DialogService { * Ask user to confirm an action. `message` explains the action and choices. * Returns promise resolving to `true`=confirm or `false`=cancel */ - confirm(message?:string) { + confirm(message?: string) { return new Promise((resolve, reject) => resolve(window.confirm(message || 'Is it OK?'))); }; diff --git a/public/docs/_examples/router-deprecated/ts/app/heroes/hero-detail.component.1.ts b/public/docs/_examples/router-deprecated/ts/app/heroes/hero-detail.component.1.ts index bb8509af21..ebfa0bf21d 100644 --- a/public/docs/_examples/router-deprecated/ts/app/heroes/hero-detail.component.1.ts +++ b/public/docs/_examples/router-deprecated/ts/app/heroes/hero-detail.component.1.ts @@ -26,9 +26,9 @@ export class HeroDetailComponent implements OnInit { // #docregion ctor constructor( - private router:Router, - private routeParams:RouteParams, - private service:HeroService){} + private router: Router, + private routeParams: RouteParams, + private service: HeroService) {} // #enddocregion ctor // #docregion ngOnInit diff --git a/public/docs/_examples/router-deprecated/ts/app/heroes/hero-detail.component.ts b/public/docs/_examples/router-deprecated/ts/app/heroes/hero-detail.component.ts index abf4d4dd3b..10e73fd27b 100644 --- a/public/docs/_examples/router-deprecated/ts/app/heroes/hero-detail.component.ts +++ b/public/docs/_examples/router-deprecated/ts/app/heroes/hero-detail.component.ts @@ -26,9 +26,9 @@ export class HeroDetailComponent implements OnInit { // #docregion ctor constructor( - private router:Router, - private routeParams:RouteParams, - private service:HeroService){} + private router: Router, + private routeParams: RouteParams, + private service: HeroService) {} // #enddocregion ctor // #docregion ngOnInit diff --git a/public/docs/_examples/router-deprecated/ts/app/heroes/hero-list.component.1.ts b/public/docs/_examples/router-deprecated/ts/app/heroes/hero-list.component.1.ts index cd11dc8e1a..cb1d20327c 100644 --- a/public/docs/_examples/router-deprecated/ts/app/heroes/hero-list.component.1.ts +++ b/public/docs/_examples/router-deprecated/ts/app/heroes/hero-list.component.1.ts @@ -30,7 +30,7 @@ export class HeroListComponent implements OnInit { // #enddocregion ctor ngOnInit() { - this.service.getHeroes().then(heroes => this.heroes = heroes) + this.service.getHeroes().then(heroes => this.heroes = heroes); } // #docregion select @@ -47,4 +47,4 @@ export class HeroListComponent implements OnInit { // #docregion link-parameters-array ['HeroDetail', { id: hero.id }] // {id: 15} // #enddocregion link-parameters-array -*/ \ No newline at end of file +*/ diff --git a/public/docs/_examples/router-deprecated/ts/app/heroes/hero-list.component.ts b/public/docs/_examples/router-deprecated/ts/app/heroes/hero-list.component.ts index 0f27e98cd6..1ca787592f 100644 --- a/public/docs/_examples/router-deprecated/ts/app/heroes/hero-list.component.ts +++ b/public/docs/_examples/router-deprecated/ts/app/heroes/hero-list.component.ts @@ -50,7 +50,7 @@ export class HeroListComponent implements OnInit { ngOnInit() { - this.service.getHeroes().then(heroes => this.heroes = heroes) + this.service.getHeroes().then(heroes => this.heroes = heroes); } } // #enddocregion diff --git a/public/docs/_examples/router-deprecated/ts/app/heroes/hero.service.ts b/public/docs/_examples/router-deprecated/ts/app/heroes/hero.service.ts index a2c4495cb6..7e5cb468b9 100644 --- a/public/docs/_examples/router-deprecated/ts/app/heroes/hero.service.ts +++ b/public/docs/_examples/router-deprecated/ts/app/heroes/hero.service.ts @@ -15,13 +15,13 @@ export class HeroService { } } -var HEROES = [ - new Hero(11, 'Mr. Nice'), - new Hero(12, 'Narco'), - new Hero(13, 'Bombasto'), - new Hero(14, 'Celeritas'), - new Hero(15, 'Magneta'), - new Hero(16, 'RubberMan') +let HEROES = [ + new Hero(11, 'Mr. Nice'), + new Hero(12, 'Narco'), + new Hero(13, 'Bombasto'), + new Hero(14, 'Celeritas'), + new Hero(15, 'Magneta'), + new Hero(16, 'RubberMan') ]; -var heroesPromise = Promise.resolve(HEROES); +let heroesPromise = Promise.resolve(HEROES); diff --git a/public/docs/_examples/router-deprecated/ts/app/main.1.ts b/public/docs/_examples/router-deprecated/ts/app/main.1.ts index 8ff3ff84fb..ce110455d4 100644 --- a/public/docs/_examples/router-deprecated/ts/app/main.1.ts +++ b/public/docs/_examples/router-deprecated/ts/app/main.1.ts @@ -16,7 +16,7 @@ bootstrap(AppComponent, [ */ // Actually use the v.1 component -import { AppComponent as ac} from './app.component.1'; +import { AppComponent as ac } from './app.component.1'; bootstrap(ac, [ // #docregion all ROUTER_PROVIDERS diff --git a/public/docs/_examples/router/e2e-spec.ts b/public/docs/_examples/router/e2e-spec.ts index 780b5e229a..d674f7593c 100644 --- a/public/docs/_examples/router/e2e-spec.ts +++ b/public/docs/_examples/router/e2e-spec.ts @@ -23,36 +23,36 @@ describe('Router', function () { heroDetail: element(by.css('my-app > undefined > div')), heroDetailTitle: element(by.css('my-app > undefined > div > h3')), - } + }; } it('should be able to see the start screen', function () { let page = getPageStruct(); expect(page.hrefs.count()).toEqual(2, 'should be two dashboard choices'); - expect(page.crisisHref.getText()).toEqual("Crisis Center"); - expect(page.heroesHref.getText()).toEqual("Heroes"); + expect(page.crisisHref.getText()).toEqual('Crisis Center'); + expect(page.heroesHref.getText()).toEqual('Heroes'); }); it('should be able to see crises center items', function () { let page = getPageStruct(); - expect(page.crisisList.count()).toBe(4, "should be 4 crisis center entries at start"); + expect(page.crisisList.count()).toBe(4, 'should be 4 crisis center entries at start'); }); it('should be able to see hero items', function () { let page = getPageStruct(); page.heroesHref.click().then(function() { expect(page.routerTitle.getText()).toContain('HEROES'); - expect(page.heroesList.count()).toBe(6, "should be 6 heroes"); + expect(page.heroesList.count()).toBe(6, 'should be 6 heroes'); }); }); it('should be able to toggle the views', function () { let page = getPageStruct(); page.crisisHref.click().then(function() { - expect(page.crisisList.count()).toBe(4, "should be 4 crisis center entries"); + expect(page.crisisList.count()).toBe(4, 'should be 4 crisis center entries'); return page.heroesHref.click(); }).then(function() { - expect(page.heroesList.count()).toBe(6, "should be 6 heroes"); + expect(page.heroesList.count()).toBe(6, 'should be 6 heroes'); }); }); @@ -77,7 +77,7 @@ describe('Router', function () { heroText = text.substr(text.indexOf(' ')).trim(); return heroEle.click(); }).then(function() { - expect(page.heroesList.count()).toBe(0, "should no longer see crisis center entries"); + expect(page.heroesList.count()).toBe(0, 'should no longer see crisis center entries'); expect(page.heroDetail.isPresent()).toBe(true, 'should be able to see crisis detail'); expect(page.heroDetailTitle.getText()).toContain(heroText); let inputEle = page.heroDetail.element(by.css('input')); @@ -88,7 +88,7 @@ describe('Router', function () { return buttonEle.click(); }).then(function() { expect(heroEle.getText()).toContain(heroText + '-foo'); - }) + }); }); function crisisCenterEdit(index: number, shouldSave: boolean) { @@ -105,7 +105,7 @@ describe('Router', function () { crisisText = text.substr(text.indexOf(' ')).trim(); return crisisEle.click(); }).then(function () { - expect(page.crisisList.count()).toBe(0, "should no longer see crisis center entries"); + expect(page.crisisList.count()).toBe(0, 'should no longer see crisis center entries'); expect(page.crisisDetail.isPresent()).toBe(true, 'should be able to see crisis detail'); expect(page.crisisDetailTitle.getText()).toContain(crisisText); let inputEle = page.crisisDetail.element(by.css('input')); diff --git a/public/docs/_examples/router/ts/app/heroes/hero-detail.component.ts b/public/docs/_examples/router/ts/app/heroes/hero-detail.component.ts index 21ab9fba8c..7255cfb799 100644 --- a/public/docs/_examples/router/ts/app/heroes/hero-detail.component.ts +++ b/public/docs/_examples/router/ts/app/heroes/hero-detail.component.ts @@ -21,7 +21,7 @@ import { Hero, HeroService } from './hero.service'; `, }) -export class HeroDetailComponent implements OnActivate { +export class HeroDetailComponent implements OnActivate { hero: Hero; // #docregion ctor diff --git a/public/docs/_examples/router/ts/app/heroes/hero-list.component.1.ts b/public/docs/_examples/router/ts/app/heroes/hero-list.component.1.ts index 967ca97ccb..1b0bcf79dd 100644 --- a/public/docs/_examples/router/ts/app/heroes/hero-list.component.1.ts +++ b/public/docs/_examples/router/ts/app/heroes/hero-list.component.1.ts @@ -1,10 +1,10 @@ // #docplaster // #docregion // TODO SOMEDAY: Feature Componetized like HeroCenter -import {Component, OnInit} from '@angular/core'; -import {Router} from '@angular/router'; +import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; -import {Hero, HeroService} from './hero.service'; +import { Hero, HeroService } from './hero.service'; @Component({ // #docregion template @@ -29,7 +29,7 @@ export class HeroListComponent implements OnInit { // #enddocregion ctor ngOnInit() { - this.service.getHeroes().then(heroes => this.heroes = heroes) + this.service.getHeroes().then(heroes => this.heroes = heroes); } // #docregion select diff --git a/public/docs/_examples/router/ts/app/heroes/hero-list.component.ts b/public/docs/_examples/router/ts/app/heroes/hero-list.component.ts index 00361ac9fe..509761ac9b 100644 --- a/public/docs/_examples/router/ts/app/heroes/hero-list.component.ts +++ b/public/docs/_examples/router/ts/app/heroes/hero-list.component.ts @@ -6,7 +6,7 @@ import { Component } from '@angular/core'; import { OnActivate, Router, RouteSegment, RouteTree } from '@angular/router'; // #enddocregion import-router -import { Hero, HeroService} from './hero.service'; +import { Hero, HeroService } from './hero.service'; @Component({ // #docregion template diff --git a/public/docs/_examples/router/ts/app/heroes/hero.service.ts b/public/docs/_examples/router/ts/app/heroes/hero.service.ts index 7ead04d9a4..c2aec9807e 100644 --- a/public/docs/_examples/router/ts/app/heroes/hero.service.ts +++ b/public/docs/_examples/router/ts/app/heroes/hero.service.ts @@ -1,5 +1,5 @@ // #docregion -import {Injectable} from '@angular/core'; +import { Injectable } from '@angular/core'; export class Hero { constructor(public id: number, public name: string) { } diff --git a/public/docs/_examples/router/ts/app/main.2.ts b/public/docs/_examples/router/ts/app/main.2.ts index 0740a43a08..d0600834dc 100644 --- a/public/docs/_examples/router/ts/app/main.2.ts +++ b/public/docs/_examples/router/ts/app/main.2.ts @@ -21,7 +21,7 @@ bootstrap(AppComponent, [ */ // Actually use the v.2 component -import {AppComponent as ac} from './app.component.2'; +import { AppComponent as ac } from './app.component.2'; bootstrap(ac, [ // #docregion diff --git a/public/docs/_examples/server-communication/e2e-spec.ts b/public/docs/_examples/server-communication/e2e-spec.ts index 417be6f6e8..c2c5ef9ff6 100644 --- a/public/docs/_examples/server-communication/e2e-spec.ts +++ b/public/docs/_examples/server-communication/e2e-spec.ts @@ -29,7 +29,7 @@ describe('Server Communication', function () { addButton.click().then(function() { expect(heroTags.count()).toBe(initialHeroCount, 'No new hero should be added'); }); - }) + }); it('should add a new hero to the list', function () { expect(heroNameInput).toBeDefined(' for hero name must exist'); @@ -40,7 +40,7 @@ describe('Server Communication', function () { let newHeroInList = heroTags.get(heroCountAfterAdd - 1).getText(); expect(newHeroInList).toBe(newHeroName, 'The hero should be added to the end of the list'); }); - }) + }); }); describe('Wikipedia Demo', function () { @@ -71,7 +71,7 @@ describe('Server Communication', function () { }); function testForRefreshedResult(keyPressed: string, done: () => void) { - testForResult('my-wiki', keyPressed, false, done) + testForResult('my-wiki', keyPressed, false, done); } }); @@ -102,11 +102,11 @@ describe('Server Communication', function () { function testForNewResult(keyPressed: string, done: () => void) { - testForResult('my-wiki-smart', keyPressed, false, done) + testForResult('my-wiki-smart', keyPressed, false, done); } function testForStaleResult(keyPressed: string, done: () => void) { - testForResult('my-wiki-smart', keyPressed, true, done) + testForResult('my-wiki-smart', keyPressed, true, done); } }); diff --git a/public/docs/_examples/server-communication/ts/app/toh/hero-list.component.promise.ts b/public/docs/_examples/server-communication/ts/app/toh/hero-list.component.promise.ts index 7df0676a9a..f1e6450124 100644 --- a/public/docs/_examples/server-communication/ts/app/toh/hero-list.component.promise.ts +++ b/public/docs/_examples/server-communication/ts/app/toh/hero-list.component.promise.ts @@ -11,13 +11,12 @@ import { HeroService } from './hero.service.promise'; }) // #docregion component export class HeroListPromiseComponent implements OnInit { - - constructor (private heroService: HeroService) {} - errorMessage: string; heroes: Hero[]; mode = 'Promise'; + constructor (private heroService: HeroService) {} + ngOnInit() { this.getHeroes(); } // #docregion methods diff --git a/public/docs/_examples/server-communication/ts/app/toh/hero-list.component.ts b/public/docs/_examples/server-communication/ts/app/toh/hero-list.component.ts index f582cfcc65..a12287dacd 100644 --- a/public/docs/_examples/server-communication/ts/app/toh/hero-list.component.ts +++ b/public/docs/_examples/server-communication/ts/app/toh/hero-list.component.ts @@ -11,13 +11,12 @@ import { HeroService } from './hero.service'; }) // #docregion component export class HeroListComponent implements OnInit { - - constructor (private heroService: HeroService) {} - errorMessage: string; heroes: Hero[]; mode = 'Observable'; + constructor (private heroService: HeroService) {} + ngOnInit() { this.getHeroes(); } // #docregion methods diff --git a/public/docs/_examples/server-communication/ts/app/toh/hero.service.promise.ts b/public/docs/_examples/server-communication/ts/app/toh/hero.service.promise.ts index c3ecd07e49..6992eb5b6e 100644 --- a/public/docs/_examples/server-communication/ts/app/toh/hero.service.promise.ts +++ b/public/docs/_examples/server-communication/ts/app/toh/hero.service.promise.ts @@ -8,11 +8,11 @@ import { Hero } from './hero'; @Injectable() export class HeroService { - constructor (private http: Http) {} - // URL to web api private heroesUrl = 'app/heroes.json'; + constructor (private http: Http) {} + // #docregion methods getHeroes (): Promise { return this.http.get(this.heroesUrl) diff --git a/public/docs/_examples/server-communication/ts/app/wiki/wiki.component.ts b/public/docs/_examples/server-communication/ts/app/wiki/wiki.component.ts index 63a0bc5f81..6253e0933b 100644 --- a/public/docs/_examples/server-communication/ts/app/wiki/wiki.component.ts +++ b/public/docs/_examples/server-communication/ts/app/wiki/wiki.component.ts @@ -20,11 +20,10 @@ import { WikipediaService } from './wikipedia.service'; providers: [JSONP_PROVIDERS, WikipediaService] }) export class WikiComponent { + items: Observable; constructor (private wikipediaService: WikipediaService) {} - items: Observable; - search (term: string) { this.items = this.wikipediaService.search(term); } diff --git a/public/docs/_examples/server-communication/ts/app/wiki/wikipedia.service.1.ts b/public/docs/_examples/server-communication/ts/app/wiki/wikipedia.service.1.ts index f57bbf06d3..518bc2b05f 100644 --- a/public/docs/_examples/server-communication/ts/app/wiki/wikipedia.service.1.ts +++ b/public/docs/_examples/server-communication/ts/app/wiki/wikipedia.service.1.ts @@ -14,7 +14,7 @@ export class WikipediaService { // #docregion query-string let queryString = - `?search=${term}&action=opensearch&format=json&callback=JSONP_CALLBACK` + `?search=${term}&action=opensearch&format=json&callback=JSONP_CALLBACK`; return this.jsonp .get(wikiUrl + queryString) diff --git a/public/docs/_examples/structural-directives/e2e-spec.ts b/public/docs/_examples/structural-directives/e2e-spec.ts index 607990a68b..082342e413 100644 --- a/public/docs/_examples/structural-directives/e2e-spec.ts +++ b/public/docs/_examples/structural-directives/e2e-spec.ts @@ -57,9 +57,9 @@ describe('Structural Directives', function () { it('should be able to use *ngIf ', function () { let setConditionButtonEle = element.all(by.css('button')).get(0); let displayEles = element.all(by.cssContainingText('p', 'Our heroes are true!')); - expect(displayEles.count()).toBe(2, "should be displaying two ngIf elements"); + expect(displayEles.count()).toBe(2, 'should be displaying two ngIf elements'); setConditionButtonEle.click().then(function() { - expect(displayEles.count()).toBe(0, "should nog longer be displaying ngIf elements"); + expect(displayEles.count()).toBe(0, 'should nog longer be displaying ngIf elements'); }); }); }); diff --git a/public/docs/_examples/structural-directives/ts/app/heavy-loader.component.ts b/public/docs/_examples/structural-directives/ts/app/heavy-loader.component.ts index 8272048b96..6eaa9309e8 100644 --- a/public/docs/_examples/structural-directives/ts/app/heavy-loader.component.ts +++ b/public/docs/_examples/structural-directives/ts/app/heavy-loader.component.ts @@ -1,5 +1,5 @@ // #docregion -import { Component, Input, Output } from '@angular/core'; +import { Component, Input, OnDestroy, OnInit } from '@angular/core'; let nextId = 1; @@ -7,7 +7,7 @@ let nextId = 1; selector: 'heavy-loader', template: 'heavy loader #{{id}} on duty!' }) -export class HeavyLoaderComponent { +export class HeavyLoaderComponent implements OnDestroy, OnInit { id = nextId++; @Input() logs: string[]; diff --git a/public/docs/_examples/structural-directives/ts/app/structural-directives.component.ts b/public/docs/_examples/structural-directives/ts/app/structural-directives.component.ts index 4620905568..1e5a9ef939 100644 --- a/public/docs/_examples/structural-directives/ts/app/structural-directives.component.ts +++ b/public/docs/_examples/structural-directives/ts/app/structural-directives.component.ts @@ -1,6 +1,6 @@ // #docplaster // #docregion -import { Component, Input, Output } from '@angular/core'; +import { Component } from '@angular/core'; import { UnlessDirective } from './unless.directive'; import { HeavyLoaderComponent } from './heavy-loader.component'; @@ -18,4 +18,4 @@ export class StructuralDirectivesComponent { logs: string[] = []; status = 'ready'; } -//#enddocregion +// #enddocregion diff --git a/public/docs/_examples/style-guide/ts/01-01/app/index.ts b/public/docs/_examples/style-guide/ts/01-01/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/01-01/app/index.ts +++ b/public/docs/_examples/style-guide/ts/01-01/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/02-07/app/index.ts b/public/docs/_examples/style-guide/ts/02-07/app/index.ts index c6b22b0506..fc87f976b3 100644 --- a/public/docs/_examples/style-guide/ts/02-07/app/index.ts +++ b/public/docs/_examples/style-guide/ts/02-07/app/index.ts @@ -1,3 +1,3 @@ export * from './heroes'; export * from './users'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/02-08/app/index.ts b/public/docs/_examples/style-guide/ts/02-08/app/index.ts index d5721a3934..ebe5c92f03 100644 --- a/public/docs/_examples/style-guide/ts/02-08/app/index.ts +++ b/public/docs/_examples/style-guide/ts/02-08/app/index.ts @@ -1,2 +1,2 @@ export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/03-01/app/index.ts b/public/docs/_examples/style-guide/ts/03-01/app/index.ts index d5721a3934..ebe5c92f03 100644 --- a/public/docs/_examples/style-guide/ts/03-01/app/index.ts +++ b/public/docs/_examples/style-guide/ts/03-01/app/index.ts @@ -1,2 +1,2 @@ export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/03-02/app/index.ts b/public/docs/_examples/style-guide/ts/03-02/app/index.ts index d5721a3934..ebe5c92f03 100644 --- a/public/docs/_examples/style-guide/ts/03-02/app/index.ts +++ b/public/docs/_examples/style-guide/ts/03-02/app/index.ts @@ -1,2 +1,2 @@ export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/03-03/app/index.ts b/public/docs/_examples/style-guide/ts/03-03/app/index.ts index d5721a3934..ebe5c92f03 100644 --- a/public/docs/_examples/style-guide/ts/03-03/app/index.ts +++ b/public/docs/_examples/style-guide/ts/03-03/app/index.ts @@ -1,2 +1,2 @@ export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/03-04/app/index.ts b/public/docs/_examples/style-guide/ts/03-04/app/index.ts index d5721a3934..ebe5c92f03 100644 --- a/public/docs/_examples/style-guide/ts/03-04/app/index.ts +++ b/public/docs/_examples/style-guide/ts/03-04/app/index.ts @@ -1,2 +1,2 @@ export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/03-05/app/index.ts b/public/docs/_examples/style-guide/ts/03-05/app/index.ts index 6dd278f3c2..aa9e5b0b7c 100644 --- a/public/docs/_examples/style-guide/ts/03-05/app/index.ts +++ b/public/docs/_examples/style-guide/ts/03-05/app/index.ts @@ -1,3 +1,3 @@ export * from './+heroes'; export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/03-06/app/index.ts b/public/docs/_examples/style-guide/ts/03-06/app/index.ts index 6dd278f3c2..aa9e5b0b7c 100644 --- a/public/docs/_examples/style-guide/ts/03-06/app/index.ts +++ b/public/docs/_examples/style-guide/ts/03-06/app/index.ts @@ -1,3 +1,3 @@ export * from './+heroes'; export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/04-10/app/index.ts b/public/docs/_examples/style-guide/ts/04-10/app/index.ts index 6dd278f3c2..aa9e5b0b7c 100644 --- a/public/docs/_examples/style-guide/ts/04-10/app/index.ts +++ b/public/docs/_examples/style-guide/ts/04-10/app/index.ts @@ -1,3 +1,3 @@ export * from './+heroes'; export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/04-10/app/shared/spinner/spinner.component.ts b/public/docs/_examples/style-guide/ts/04-10/app/shared/spinner/spinner.component.ts index 74a83800e7..1fd2a01500 100644 --- a/public/docs/_examples/style-guide/ts/04-10/app/shared/spinner/spinner.component.ts +++ b/public/docs/_examples/style-guide/ts/04-10/app/shared/spinner/spinner.component.ts @@ -1,4 +1,4 @@ -import {Component, OnDestroy, OnInit} from '@angular/core'; +import { Component, OnDestroy, OnInit } from '@angular/core'; import { SpinnerService } from './spinner.service'; diff --git a/public/docs/_examples/style-guide/ts/04-14/app/index.ts b/public/docs/_examples/style-guide/ts/04-14/app/index.ts index 6dd278f3c2..aa9e5b0b7c 100644 --- a/public/docs/_examples/style-guide/ts/04-14/app/index.ts +++ b/public/docs/_examples/style-guide/ts/04-14/app/index.ts @@ -1,3 +1,3 @@ export * from './+heroes'; export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-02/app/index.ts b/public/docs/_examples/style-guide/ts/05-02/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/05-02/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-02/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-03/app/index.ts b/public/docs/_examples/style-guide/ts/05-03/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/05-03/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-03/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-04/app/index.ts b/public/docs/_examples/style-guide/ts/05-04/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/05-04/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-04/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-12/app/index.ts b/public/docs/_examples/style-guide/ts/05-12/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/05-12/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-12/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-13/app/index.ts b/public/docs/_examples/style-guide/ts/05-13/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/05-13/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-13/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-14/app/index.ts b/public/docs/_examples/style-guide/ts/05-14/app/index.ts index d5721a3934..ebe5c92f03 100644 --- a/public/docs/_examples/style-guide/ts/05-14/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-14/app/index.ts @@ -1,2 +1,2 @@ export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-15/app/index.ts b/public/docs/_examples/style-guide/ts/05-15/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/05-15/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-15/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-16/app/index.ts b/public/docs/_examples/style-guide/ts/05-16/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/05-16/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-16/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/05-17/app/index.ts b/public/docs/_examples/style-guide/ts/05-17/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/05-17/app/index.ts +++ b/public/docs/_examples/style-guide/ts/05-17/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/06-01/app/index.ts b/public/docs/_examples/style-guide/ts/06-01/app/index.ts index d5721a3934..ebe5c92f03 100644 --- a/public/docs/_examples/style-guide/ts/06-01/app/index.ts +++ b/public/docs/_examples/style-guide/ts/06-01/app/index.ts @@ -1,2 +1,2 @@ export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/06-03/app/index.ts b/public/docs/_examples/style-guide/ts/06-03/app/index.ts index d5721a3934..ebe5c92f03 100644 --- a/public/docs/_examples/style-guide/ts/06-03/app/index.ts +++ b/public/docs/_examples/style-guide/ts/06-03/app/index.ts @@ -1,2 +1,2 @@ export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/07-01/app/index.ts b/public/docs/_examples/style-guide/ts/07-01/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/07-01/app/index.ts +++ b/public/docs/_examples/style-guide/ts/07-01/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/07-03/app/index.ts b/public/docs/_examples/style-guide/ts/07-03/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/07-03/app/index.ts +++ b/public/docs/_examples/style-guide/ts/07-03/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/07-04/app/app.component.ts b/public/docs/_examples/style-guide/ts/07-04/app/app.component.ts index e938b12036..b0bc9677fe 100644 --- a/public/docs/_examples/style-guide/ts/07-04/app/app.component.ts +++ b/public/docs/_examples/style-guide/ts/07-04/app/app.component.ts @@ -1,5 +1,5 @@ // #docregion -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { HeroArena, HeroService, Hero } from './heroes'; @@ -8,7 +8,7 @@ import { HeroArena, HeroService, Hero } from './heroes'; template: '
{{heroes | json}}
', providers: [HeroArena, HeroService] }) -export class AppComponent { +export class AppComponent implements OnInit { heroes: Hero[] = []; constructor(private heroArena: HeroArena) { } diff --git a/public/docs/_examples/style-guide/ts/07-04/app/index.ts b/public/docs/_examples/style-guide/ts/07-04/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/07-04/app/index.ts +++ b/public/docs/_examples/style-guide/ts/07-04/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/09-01/app/index.ts b/public/docs/_examples/style-guide/ts/09-01/app/index.ts index 0d27e4612c..fe8300f1dd 100644 --- a/public/docs/_examples/style-guide/ts/09-01/app/index.ts +++ b/public/docs/_examples/style-guide/ts/09-01/app/index.ts @@ -1,2 +1,2 @@ export * from './heroes'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/style-guide/ts/10-01/app/index.ts b/public/docs/_examples/style-guide/ts/10-01/app/index.ts index 0a909b24c9..033b419bdc 100644 --- a/public/docs/_examples/style-guide/ts/10-01/app/index.ts +++ b/public/docs/_examples/style-guide/ts/10-01/app/index.ts @@ -1,4 +1,4 @@ export * from './+dashboard'; export * from './+heroes'; export * from './shared'; -export * from './app.component'; \ No newline at end of file +export * from './app.component'; diff --git a/public/docs/_examples/template-syntax/e2e-spec.ts b/public/docs/_examples/template-syntax/e2e-spec.ts index 48f69ba051..84522a9f03 100644 --- a/public/docs/_examples/template-syntax/e2e-spec.ts +++ b/public/docs/_examples/template-syntax/e2e-spec.ts @@ -12,14 +12,14 @@ describe('Template Syntax', function () { }); it('should be able to use interpolation with a calculation', function () { - let theSumEles = element.all(by.cssContainingText('h3~p','The sum of')); + let theSumEles = element.all(by.cssContainingText('h3~p', 'The sum of')); expect(theSumEles.count()).toBe(2); expect(theSumEles.get(0).getText()).toEqual('The sum of 1 + 1 is 2'); expect(theSumEles.get(1).getText()).toEqual('The sum of 1 + 1 is not 4'); }); it('should be able to use class binding syntax', function () { - let specialEle = element(by.cssContainingText('div','Special')); + let specialEle = element(by.cssContainingText('div', 'Special')); expect(specialEle.getAttribute('class')).toMatch('special'); }); diff --git a/public/docs/_examples/template-syntax/ts/app/decorator.directive.ts b/public/docs/_examples/template-syntax/ts/app/decorator.directive.ts index a7e9c7d93c..c736b85998 100644 --- a/public/docs/_examples/template-syntax/ts/app/decorator.directive.ts +++ b/public/docs/_examples/template-syntax/ts/app/decorator.directive.ts @@ -5,7 +5,7 @@ import { Directive, ElementRef } from '@angular/core'; // set the selector for the element type to spy on. @Directive({selector: 'select'}) export class DecoratorDirective { - constructor(el: ElementRef){ - console.log(el) + constructor(el: ElementRef) { + console.log(el); } -} \ No newline at end of file +} diff --git a/public/docs/_examples/template-syntax/ts/app/hero-detail.component.ts b/public/docs/_examples/template-syntax/ts/app/hero-detail.component.ts index b613fa63b4..e5b46971fa 100644 --- a/public/docs/_examples/template-syntax/ts/app/hero-detail.component.ts +++ b/public/docs/_examples/template-syntax/ts/app/hero-detail.component.ts @@ -13,7 +13,7 @@ let nextHeroDetailId = 1; inputs: ['hero'], outputs: ['deleteRequest'], // #enddocregion input-output-2 - styles:['button { margin-left: 8px} div {margin: 8px 0} img {height:24px}'], + styles: ['button { margin-left: 8px} div {margin: 8px 0} img {height:24px}'], // #docregion template-1 template: `
@@ -28,6 +28,12 @@ let nextHeroDetailId = 1; }) // #enddocregion input-output-2 export class HeroDetailComponent { + hero: Hero = new Hero('', 'Zzzzzzzz'); // default sleeping hero + // heroImageUrl = 'http://www.wpclipart.com/cartoon/people/hero/hero_silhoutte_T.png'; + // Public Domain terms of use: http://www.wpclipart.com/terms.html + heroImageUrl = 'images/hero.png'; + lineThrough = ''; + @Input() prefix = ''; // #docregion deleteRequest // This component make a request but it can't actually delete a hero. @@ -40,13 +46,6 @@ export class HeroDetailComponent { // #docregion deleteRequest } // #enddocregion deleteRequest - - hero: Hero = new Hero('','Zzzzzzzz'); // default sleeping hero - // heroImageUrl = 'http://www.wpclipart.com/cartoon/people/hero/hero_silhoutte_T.png'; - // Public Domain terms of use: http://www.wpclipart.com/terms.html - heroImageUrl = 'images/hero.png'; - lineThrough = ''; - @Input() prefix = ''; } @Component({ diff --git a/public/docs/_examples/template-syntax/ts/app/hero.ts b/public/docs/_examples/template-syntax/ts/app/hero.ts index aca1fd5a72..ecf4d58c43 100644 --- a/public/docs/_examples/template-syntax/ts/app/hero.ts +++ b/public/docs/_examples/template-syntax/ts/app/hero.ts @@ -1,23 +1,4 @@ export class Hero { - public id:number - - constructor( - public firstName:string, - public lastName?:string, - public birthdate?:Date, - public url?:string, - public rate:number = 100, - id?:number) { - - this.id = id != null ? id : Hero.nextId++; - } - - static clone({firstName, lastName, birthdate, url, rate, id} : Hero){ - return new Hero (firstName, lastName, birthdate, url, rate, id ); - } - - get fullName() {return `${this.firstName} ${this.lastName}`;} - static nextId = 1; static MockHeroes = [ @@ -33,4 +14,23 @@ export class Hero { new Hero('Miny', 'Toe'), new Hero('Moe', 'Toe') ]; -} \ No newline at end of file + + public id: number; + + static clone({firstName, lastName, birthdate, url, rate, id}: Hero) { + return new Hero(firstName, lastName, birthdate, url, rate, id); + } + + constructor( + public firstName: string, + public lastName?: string, + public birthdate?: Date, + public url?: string, + public rate = 100, + id?: number) { + + this.id = id != null ? id : Hero.nextId++; + } + + get fullName() { return `${this.firstName} ${this.lastName}`; } +} diff --git a/public/docs/_examples/template-syntax/ts/app/main.ts b/public/docs/_examples/template-syntax/ts/app/main.ts index 19551339f8..42dbeb9f7d 100644 --- a/public/docs/_examples/template-syntax/ts/app/main.ts +++ b/public/docs/_examples/template-syntax/ts/app/main.ts @@ -2,4 +2,4 @@ import { bootstrap } from '@angular/platform-browser-dynamic'; import { AppComponent } from './app.component'; -bootstrap(AppComponent); \ No newline at end of file +bootstrap(AppComponent); diff --git a/public/docs/_examples/template-syntax/ts/app/my-click.directive.ts b/public/docs/_examples/template-syntax/ts/app/my-click.directive.ts index 4b2b23b5cf..e88951b2a5 100644 --- a/public/docs/_examples/template-syntax/ts/app/my-click.directive.ts +++ b/public/docs/_examples/template-syntax/ts/app/my-click.directive.ts @@ -1,39 +1,40 @@ // #docplaster import { Directive, ElementRef, EventEmitter, Output } from '@angular/core'; -@Directive({selector:'[myClick]'}) +@Directive({selector: '[myClick]'}) export class MyClickDirective { // #docregion my-click-output-1 @Output('myClick') clicks = new EventEmitter(); // @Output(alias) propertyName = ... // #enddocregion my-click-output-1 - constructor(el: ElementRef){ + toggle = false; + + constructor(el: ElementRef) { el.nativeElement - .addEventListener('click', (event:Event) => { + .addEventListener('click', (event: Event) => { this.toggle = !this.toggle; this.clicks.emit(this.toggle ? 'Click!' : ''); }); } - toggle = false; } // #docregion my-click-output-2 @Directive({ // #enddocregion my-click-output-2 - selector:'[myClick2]', + selector: '[myClick2]', // #docregion my-click-output-2 - outputs:['clicks:myClick'] // propertyName:alias + outputs: ['clicks:myClick'] // propertyName:alias }) // #enddocregion my-click-output-2 export class MyClickDirective2 { clicks = new EventEmitter(); + toggle = false; - constructor(el: ElementRef){ + constructor(el: ElementRef) { el.nativeElement - .addEventListener('click', (event:Event) => { + .addEventListener('click', (event: Event) => { this.toggle = !this.toggle; this.clicks.emit(this.toggle ? 'Click2!' : ''); }); } - toggle = false; } diff --git a/public/docs/_examples/testing/ts/app/app.component.spec.ts b/public/docs/_examples/testing/ts/app/app.component.spec.ts index ce17ae744a..78653e5aa5 100644 --- a/public/docs/_examples/testing/ts/app/app.component.spec.ts +++ b/public/docs/_examples/testing/ts/app/app.component.spec.ts @@ -17,7 +17,7 @@ import { Hero, HeroService, MockHeroService } from './mock-hero.service'; import { Router, MockRouter, RouterLink, MockRouterLink, - RouterOutlet, MockRouterOutlet} from './mock-router'; + RouterOutlet, MockRouterOutlet } from './mock-router'; describe('AppComponent', () => { let fixture: ComponentFixture; diff --git a/public/docs/_examples/testing/ts/app/bag.spec.ts b/public/docs/_examples/testing/ts/app/bag.spec.ts index 91e689e8b4..80790fca67 100644 --- a/public/docs/_examples/testing/ts/app/bag.spec.ts +++ b/public/docs/_examples/testing/ts/app/bag.spec.ts @@ -1,5 +1,5 @@ // Based on https://github.com/angular/angular/blob/master/modules/angular2/test/testing/testing_public_spec.ts -/* tslint:disable:no-unused-variable */ +/* tslint:disable */ import { BadTemplateUrl, ButtonComp, ChildChildComp, ChildComp, ChildWithChildComp, diff --git a/public/docs/_examples/testing/ts/app/bag.ts b/public/docs/_examples/testing/ts/app/bag.ts index 94be448e7e..26f47e8b3d 100644 --- a/public/docs/_examples/testing/ts/app/bag.ts +++ b/public/docs/_examples/testing/ts/app/bag.ts @@ -1,5 +1,5 @@ // Based on https://github.com/angular/angular/blob/master/modules/angular2/test/testing/testing_public_spec.ts -/* tslint:disable:forin */ +/* tslint:disable */ import { Component, EventEmitter, Injectable, Input, Output, Optional, OnInit, OnChanges, OnDestroy, SimpleChange } from '@angular/core'; diff --git a/public/docs/_examples/testing/ts/app/expect-proper.ts b/public/docs/_examples/testing/ts/app/expect-proper.ts index 6712b879d1..77f3deb928 100644 --- a/public/docs/_examples/testing/ts/app/expect-proper.ts +++ b/public/docs/_examples/testing/ts/app/expect-proper.ts @@ -1,5 +1,5 @@ // See https://github.com/angular/angular/issues/9017 -import { expect as expectCore} from '@angular/core/testing'; +import { expect as expectCore } from '@angular/core/testing'; import { NgMatchers } from '@angular/platform-browser/testing'; export function expect(spy: Function): NgMatchers; diff --git a/public/docs/_examples/testing/ts/app/hero-detail.component.ts b/public/docs/_examples/testing/ts/app/hero-detail.component.ts index 5cc03cff4b..3fcbf071e0 100644 --- a/public/docs/_examples/testing/ts/app/hero-detail.component.ts +++ b/public/docs/_examples/testing/ts/app/hero-detail.component.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ // #docplaster // #docregion // #docregion v2 diff --git a/public/docs/_examples/testing/ts/app/hero.service.ts b/public/docs/_examples/testing/ts/app/hero.service.ts index fd6d5bb128..f83588934b 100644 --- a/public/docs/_examples/testing/ts/app/hero.service.ts +++ b/public/docs/_examples/testing/ts/app/hero.service.ts @@ -13,16 +13,16 @@ export class HeroService { // See the "Take it slow" appendix getHeroesSlowly() { return new Promise(resolve => - setTimeout(()=>resolve(HEROES), 2000) // 2 seconds + setTimeout(() => resolve(HEROES), 2000) // 2 seconds ); } - //#docregion get-hero + // #docregion get-hero getHero(id: number) { return Promise.resolve(HEROES).then( heroes => heroes.filter(hero => hero.id === id)[0] ); } - //#enddocregion get-hero + // #enddocregion get-hero } -// #enddocregion \ No newline at end of file +// #enddocregion diff --git a/public/docs/_examples/testing/ts/app/http-hero.service.ts b/public/docs/_examples/testing/ts/app/http-hero.service.ts index 39b0991f7b..bfde5bfdc8 100644 --- a/public/docs/_examples/testing/ts/app/http-hero.service.ts +++ b/public/docs/_examples/testing/ts/app/http-hero.service.ts @@ -1,15 +1,17 @@ // #docplaster // #docregion -import {Injectable} from '@angular/core'; -import {Http, Response} from '@angular/http'; -import {Headers, RequestOptions} from '@angular/http'; -import {Hero} from './hero'; -import {Observable} from 'rxjs/Observable'; +import { Injectable } from '@angular/core'; +import { Http, Response } from '@angular/http'; +import { Headers, RequestOptions } from '@angular/http'; +import { Hero } from './hero'; +import { Observable } from 'rxjs/Observable'; @Injectable() export class HeroService { - constructor (private http: Http) {} private _heroesUrl = 'app/heroes'; // URL to web api + + constructor (private http: Http) {} + getHeroes (): Observable { return this.http.get(this._heroesUrl) .map(this.extractData) diff --git a/public/docs/_examples/testing/ts/app/mock-router.ts b/public/docs/_examples/testing/ts/app/mock-router.ts index 547629f53d..a49763f7cf 100644 --- a/public/docs/_examples/testing/ts/app/mock-router.ts +++ b/public/docs/_examples/testing/ts/app/mock-router.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ export * from '@angular/router-deprecated'; import { Directive, DynamicComponentLoader, ViewContainerRef, diff --git a/public/docs/_examples/toh-1/ts/app/app.component.ts b/public/docs/_examples/toh-1/ts/app/app.component.ts index b3cd4e8f55..73ac649198 100644 --- a/public/docs/_examples/toh-1/ts/app/app.component.ts +++ b/public/docs/_examples/toh-1/ts/app/app.component.ts @@ -10,7 +10,7 @@ export class Hero { @Component({ selector: 'my-app', - template:` + template: `

{{title}}

{{hero.name}} details!

{{hero.id}}
diff --git a/public/docs/_examples/toh-2/ts/app/app.component.ts b/public/docs/_examples/toh-2/ts/app/app.component.ts index 2dee49f08c..b883276ca5 100644 --- a/public/docs/_examples/toh-2/ts/app/app.component.ts +++ b/public/docs/_examples/toh-2/ts/app/app.component.ts @@ -8,7 +8,7 @@ export class Hero { @Component({ selector: 'my-app', - template:` + template: `

{{title}}

My Heroes

    @@ -28,7 +28,7 @@ export class Hero {
`, // #docregion styles-1 - styles:[` + styles: [` .selected { background-color: #CFD8DC !important; color: white; @@ -93,17 +93,17 @@ export class AppComponent { // #enddocregion pt2 // #docregion hero-array -var HEROES: Hero[] = [ - { "id": 11, "name": "Mr. Nice" }, - { "id": 12, "name": "Narco" }, - { "id": 13, "name": "Bombasto" }, - { "id": 14, "name": "Celeritas" }, - { "id": 15, "name": "Magneta" }, - { "id": 16, "name": "RubberMan" }, - { "id": 17, "name": "Dynama" }, - { "id": 18, "name": "Dr IQ" }, - { "id": 19, "name": "Magma" }, - { "id": 20, "name": "Tornado" } +const HEROES: Hero[] = [ + { id: 11, name: 'Mr. Nice' }, + { id: 12, name: 'Narco' }, + { id: 13, name: 'Bombasto' }, + { id: 14, name: 'Celeritas' }, + { id: 15, name: 'Magneta' }, + { id: 16, name: 'RubberMan' }, + { id: 17, name: 'Dynama' }, + { id: 18, name: 'Dr IQ' }, + { id: 19, name: 'Magma' }, + { id: 20, name: 'Tornado' } ]; // #enddocregion hero-array diff --git a/public/docs/_examples/toh-3/ts/app/app.component.ts b/public/docs/_examples/toh-3/ts/app/app.component.ts index 9fc4f99910..9ac1740f68 100644 --- a/public/docs/_examples/toh-3/ts/app/app.component.ts +++ b/public/docs/_examples/toh-3/ts/app/app.component.ts @@ -1,4 +1,4 @@ -//#docregion +// #docregion import { Component } from '@angular/core'; // #docregion hero-import @@ -11,7 +11,7 @@ import { HeroDetailComponent } from './hero-detail.component'; @Component({ selector: 'my-app', // #docregion hero-detail-template - template:` + template: `

{{title}}

My Heroes

    @@ -24,7 +24,7 @@ import { HeroDetailComponent } from './hero-detail.component'; `, // #enddocregion hero-detail-template - styles:[` + styles: [` .selected { background-color: #CFD8DC !important; color: white; @@ -85,15 +85,15 @@ export class AppComponent { onSelect(hero: Hero) { this.selectedHero = hero; } } -var HEROES: Hero[] = [ - { "id": 11, "name": "Mr. Nice" }, - { "id": 12, "name": "Narco" }, - { "id": 13, "name": "Bombasto" }, - { "id": 14, "name": "Celeritas" }, - { "id": 15, "name": "Magneta" }, - { "id": 16, "name": "RubberMan" }, - { "id": 17, "name": "Dynama" }, - { "id": 18, "name": "Dr IQ" }, - { "id": 19, "name": "Magma" }, - { "id": 20, "name": "Tornado" } +const HEROES: Hero[] = [ + { id: 11, name: 'Mr. Nice' }, + { id: 12, name: 'Narco' }, + { id: 13, name: 'Bombasto' }, + { id: 14, name: 'Celeritas' }, + { id: 15, name: 'Magneta' }, + { id: 16, name: 'RubberMan' }, + { id: 17, name: 'Dynama' }, + { id: 18, name: 'Dr IQ' }, + { id: 19, name: 'Magma' }, + { id: 20, name: 'Tornado' } ]; diff --git a/public/docs/_examples/toh-3/ts/app/hero-detail.component.ts b/public/docs/_examples/toh-3/ts/app/hero-detail.component.ts index 1192359265..a2f1942904 100644 --- a/public/docs/_examples/toh-3/ts/app/hero-detail.component.ts +++ b/public/docs/_examples/toh-3/ts/app/hero-detail.component.ts @@ -24,15 +24,15 @@ import { Hero } from './hero'; ` // #enddocregion template -// #docregion v1 +// #docregion v1 }) export class HeroDetailComponent { // #enddocregion v1 // #docregion hero-input - @Input() -// #docregion hero + @Input() +// #docregion hero hero: Hero; -// #enddocregion hero +// #enddocregion hero // #enddocregion hero-input // #docregion v1 } diff --git a/public/docs/_examples/toh-4/ts/app/app.component.1.ts b/public/docs/_examples/toh-4/ts/app/app.component.1.ts index 42558a8a4b..42a0c8b622 100644 --- a/public/docs/_examples/toh-4/ts/app/app.component.1.ts +++ b/public/docs/_examples/toh-4/ts/app/app.component.1.ts @@ -42,7 +42,7 @@ export class AppComponent implements OnInit { // #enddocregion ctor // #docregion getHeroes getHeroes() { - //#docregion get-heroes + // #docregion get-heroes this.heroes = this.heroService.getHeroes(); // #enddocregion get-heroes } diff --git a/public/docs/_examples/toh-4/ts/app/app.component.ts b/public/docs/_examples/toh-4/ts/app/app.component.ts index 7ca63ee237..cf2b42a034 100644 --- a/public/docs/_examples/toh-4/ts/app/app.component.ts +++ b/public/docs/_examples/toh-4/ts/app/app.component.ts @@ -11,7 +11,7 @@ import { HeroService } from './hero.service'; @Component({ selector: 'my-app', // #docregion template - template:` + template: `

    {{title}}

    My Heroes

      diff --git a/public/docs/_examples/toh-4/ts/app/hero.service.ts b/public/docs/_examples/toh-4/ts/app/hero.service.ts index 943c8fe2d9..d784b43c17 100644 --- a/public/docs/_examples/toh-4/ts/app/hero.service.ts +++ b/public/docs/_examples/toh-4/ts/app/hero.service.ts @@ -18,7 +18,7 @@ export class HeroService { // #docregion get-heroes-slowly getHeroesSlowly() { return new Promise(resolve => - setTimeout(()=>resolve(HEROES), 2000) // 2 seconds + setTimeout(() => resolve(HEROES), 2000) // 2 seconds ); } // #enddocregion get-heroes-slowly diff --git a/public/docs/_examples/toh-5/e2e-spec.ts b/public/docs/_examples/toh-5/e2e-spec.ts index 4266a2b5ce..584b6ba663 100644 --- a/public/docs/_examples/toh-5/e2e-spec.ts +++ b/public/docs/_examples/toh-5/e2e-spec.ts @@ -19,19 +19,19 @@ describe('Tutorial', function () { allHeroes: element.all(by.css('my-app my-heroes li')), heroDetail: element(by.css('my-app my-hero-detail')) - } + }; } it('should be able to see the start screen', function () { let page = getPageStruct(); expect(page.hrefs.count()).toEqual(2, 'should be two dashboard choices'); - expect(page.myDashboardHref.getText()).toEqual("Dashboard"); - expect(page.myHeroesHref.getText()).toEqual("Heroes"); + expect(page.myDashboardHref.getText()).toEqual('Dashboard'); + expect(page.myHeroesHref.getText()).toEqual('Heroes'); }); it('should be able to see dashboard choices', function () { let page = getPageStruct(); - expect(page.topHeroes.count()).toBe(4, "should be 4 dashboard hero choices"); + expect(page.topHeroes.count()).toBe(4, 'should be 4 dashboard hero choices'); }); it('should be able to toggle the views', function () { @@ -40,7 +40,7 @@ describe('Tutorial', function () { expect(page.myDashboardParent.element(by.css('h3')).getText()).toEqual('Top Heroes'); page.myHeroesHref.click().then(function() { expect(page.myDashboardParent.isPresent()).toBe(false, 'should no longer see dashboard element'); - expect(page.allHeroes.count()).toBeGreaterThan(4, "should be more than 4 heroes shown"); + expect(page.allHeroes.count()).toBeGreaterThan(4, 'should be more than 4 heroes shown'); return page.myDashboardHref.click(); }).then(function() { expect(page.myDashboardParent.isPresent()).toBe(true, 'should once again see the dashboard element'); @@ -79,7 +79,7 @@ describe('Tutorial', function () { return heroEle.getText(); }).then(function(text) { // remove leading 'id' from the element - heroDescr = text.substr(text.indexOf(' ')+1); + heroDescr = text.substr(text.indexOf(' ') + 1); return heroEle.click(); }).then(function() { expect(viewDetailsButtonEle.isDisplayed()).toBe(true, 'viewDetails button should now be visible'); diff --git a/public/docs/_examples/toh-5/ts/app/dashboard.component.2.ts b/public/docs/_examples/toh-5/ts/app/dashboard.component.2.ts index 3825a7625c..2d51b37007 100644 --- a/public/docs/_examples/toh-5/ts/app/dashboard.component.2.ts +++ b/public/docs/_examples/toh-5/ts/app/dashboard.component.2.ts @@ -19,9 +19,9 @@ export class DashboardComponent implements OnInit { ngOnInit() { this.heroService.getHeroes() - .then(heroes => this.heroes = heroes.slice(1,5)); + .then(heroes => this.heroes = heroes.slice(1, 5)); } - gotoDetail(){ /* not implemented yet */} + gotoDetail() { /* not implemented yet */} } // #enddocregion component diff --git a/public/docs/_examples/toh-5/ts/app/dashboard.component.ts b/public/docs/_examples/toh-5/ts/app/dashboard.component.ts index 64489ff312..3d54f5ab4b 100644 --- a/public/docs/_examples/toh-5/ts/app/dashboard.component.ts +++ b/public/docs/_examples/toh-5/ts/app/dashboard.component.ts @@ -31,7 +31,7 @@ export class DashboardComponent implements OnInit { ngOnInit() { this.heroService.getHeroes() - .then(heroes => this.heroes = heroes.slice(1,5)); + .then(heroes => this.heroes = heroes.slice(1, 5)); } // #docregion goto-detail @@ -41,4 +41,4 @@ export class DashboardComponent implements OnInit { } // #enddocregion goto-detail } -// #enddocregion \ No newline at end of file +// #enddocregion diff --git a/public/docs/_examples/toh-5/ts/app/hero.service.ts b/public/docs/_examples/toh-5/ts/app/hero.service.ts index efc348509b..9bae27f006 100644 --- a/public/docs/_examples/toh-5/ts/app/hero.service.ts +++ b/public/docs/_examples/toh-5/ts/app/hero.service.ts @@ -13,15 +13,15 @@ export class HeroService { // See the "Take it slow" appendix getHeroesSlowly() { return new Promise(resolve => - setTimeout(()=>resolve(HEROES), 2000) // 2 seconds + setTimeout(() => resolve(HEROES), 2000) // 2 seconds ); } - //#docregion get-hero + // #docregion get-hero getHero(id: number) { return this.getHeroes() .then(heroes => heroes.filter(hero => hero.id === id)[0]); } - //#enddocregion get-hero + // #enddocregion get-hero } -// #enddocregion \ No newline at end of file +// #enddocregion diff --git a/public/docs/_examples/toh-6/e2e-spec.ts b/public/docs/_examples/toh-6/e2e-spec.ts index bec10800b4..faf5787bae 100644 --- a/public/docs/_examples/toh-6/e2e-spec.ts +++ b/public/docs/_examples/toh-6/e2e-spec.ts @@ -37,7 +37,7 @@ describe('TOH Http Chapter', function () { }).then(function() { return page.addButton.click(); }).then(function(){ - return save(page,'','The New Hero'); + return save(page, '', 'The New Hero'); }).then(function(){ browser.waitForAngular(); diff --git a/public/docs/_examples/toh-6/ts/app/dashboard.component.ts b/public/docs/_examples/toh-6/ts/app/dashboard.component.ts index 988d51fee9..8ca1e3a2e2 100644 --- a/public/docs/_examples/toh-6/ts/app/dashboard.component.ts +++ b/public/docs/_examples/toh-6/ts/app/dashboard.component.ts @@ -22,7 +22,7 @@ export class DashboardComponent implements OnInit { ngOnInit() { this.heroService.getHeroes() - .then(heroes => this.heroes = heroes.slice(1,5)); + .then(heroes => this.heroes = heroes.slice(1, 5)); } gotoDetail(hero: Hero) { diff --git a/public/docs/_examples/upgrade-adapter/ts/app/1-2-hybrid-bootstrap/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/1-2-hybrid-bootstrap/app.module.ts index 2e2b7b5b54..b4926d8c69 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/1-2-hybrid-bootstrap/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/1-2-hybrid-bootstrap/app.module.ts @@ -1,4 +1,4 @@ -declare var angular:any; +declare var angular: any; // #docregion bootstrap import { UpgradeAdapter } from '@angular/upgrade'; diff --git a/public/docs/_examples/upgrade-adapter/ts/app/1-2-hybrid-shared-adapter-bootstrap/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/1-2-hybrid-shared-adapter-bootstrap/app.module.ts index f7e1ba4b13..fdcba54580 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/1-2-hybrid-shared-adapter-bootstrap/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/1-2-hybrid-shared-adapter-bootstrap/app.module.ts @@ -3,7 +3,7 @@ import { upgradeAdapter } from './upgrade_adapter'; // #enddocregion bootstrap -declare var angular:any; +declare var angular: any; angular.module('heroApp', []) .controller('MainCtrl', function() { diff --git a/public/docs/_examples/upgrade-adapter/ts/app/1-bootstrap/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/1-bootstrap/app.module.ts index c4b56a5ca6..7b9d8c8dab 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/1-bootstrap/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/1-bootstrap/app.module.ts @@ -1,4 +1,4 @@ -declare var angular:any; +declare var angular: any; angular.module('heroApp', []) .controller('MainCtrl', function() { diff --git a/public/docs/_examples/upgrade-adapter/ts/app/1-ng-app/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/1-ng-app/app.module.ts index 427c605de3..37241e1a07 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/1-ng-app/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/1-ng-app/app.module.ts @@ -1,4 +1,4 @@ -declare var angular:any; +declare var angular: any; angular.module('heroApp', []) .controller('MainCtrl', function() { diff --git a/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-projection/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-projection/app.module.ts index 2534ebd99a..ad48568e09 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-projection/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-projection/app.module.ts @@ -3,7 +3,7 @@ import { UpgradeAdapter } from '@angular/upgrade'; import { MainController } from './main.controller'; import { HeroDetailComponent } from './hero-detail.component'; -declare var angular:any; +declare var angular: any; const upgradeAdapter = new UpgradeAdapter(); angular.module('heroApp', []) diff --git a/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-providers/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-providers/app.module.ts index a38d87d6f5..7ae5fd331d 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-providers/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-providers/app.module.ts @@ -2,7 +2,7 @@ import { HeroDetailComponent } from './hero-detail.component'; import { HeroesService } from './heroes.service'; import { upgradeAdapter } from './upgrade_adapter'; -declare var angular:any; +declare var angular: any; // #docregion register angular.module('heroApp', []) diff --git a/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-providers/hero-detail.component.ts b/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-providers/hero-detail.component.ts index fa1c26a9fa..3ad50cd961 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-providers/hero-detail.component.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/1-to-2-providers/hero-detail.component.ts @@ -10,8 +10,8 @@ import { Hero } from '../hero'; ` }) export class HeroDetailComponent { - hero:Hero; - constructor(@Inject('heroes') heroes:HeroesService) { + hero: Hero; + constructor(@Inject('heroes') heroes: HeroesService) { this.hero = heroes.get()[0]; } } diff --git a/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-providers/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-providers/app.module.ts index 657c4d25cc..9ab3f70e94 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-providers/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-providers/app.module.ts @@ -2,14 +2,14 @@ import { heroDetailComponent } from './hero-detail.component'; import { Heroes } from './heroes'; import { upgradeAdapter } from './upgrade_adapter'; -declare var angular:any; +declare var angular: any; // #docregion register upgradeAdapter.addProvider(Heroes); angular.module('heroApp', []) .factory('heroes', upgradeAdapter.downgradeNg2Provider(Heroes)) - .component('heroDetail', heroDetailComponent) + .component('heroDetail', heroDetailComponent); // #enddocregion register upgradeAdapter.bootstrap( diff --git a/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-providers/hero-detail.component.ts b/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-providers/hero-detail.component.ts index d736117ce0..dd7aa10d79 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-providers/hero-detail.component.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-providers/hero-detail.component.ts @@ -5,7 +5,7 @@ export const heroDetailComponent = { template: `

      {{$ctrl.hero.id}}: {{$ctrl.hero.name}}

      `, - controller: ['heroes', function(heroes:Heroes) { + controller: ['heroes', function(heroes: Heroes) { this.hero = heroes.get()[0]; }] }; diff --git a/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-transclusion/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-transclusion/app.module.ts index ab16d3a24d..426d718c38 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-transclusion/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/2-to-1-transclusion/app.module.ts @@ -3,11 +3,11 @@ import { ContainerComponent } from './container.component'; import { heroDetailComponent } from './hero-detail.component'; import { upgradeAdapter } from './upgrade_adapter'; -declare var angular:any; +declare var angular: any; angular.module('heroApp', []) .directive('myContainer', upgradeAdapter.downgradeNg2Component(ContainerComponent)) - .component('heroDetail', heroDetailComponent) + .component('heroDetail', heroDetailComponent); upgradeAdapter.bootstrap( document.querySelector('hero-app'), diff --git a/public/docs/_examples/upgrade-adapter/ts/app/downgrade-io/hero-detail.component.ts b/public/docs/_examples/upgrade-adapter/ts/app/downgrade-io/hero-detail.component.ts index 12879ac980..94082813fd 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/downgrade-io/hero-detail.component.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/downgrade-io/hero-detail.component.ts @@ -1,6 +1,6 @@ // #docregion import { Component, EventEmitter, Input, Output } from '@angular/core'; -import {Hero} from '../hero'; +import { Hero } from '../hero'; @Component({ selector: 'hero-detail', @@ -11,7 +11,7 @@ import {Hero} from '../hero'; ` }) export class HeroDetailComponent { - @Input() hero:Hero + @Input() hero: Hero; @Output() deleted = new EventEmitter(); onDelete() { this.deleted.emit(this.hero); diff --git a/public/docs/_examples/upgrade-adapter/ts/app/downgrade-io/main.controller.ts b/public/docs/_examples/upgrade-adapter/ts/app/downgrade-io/main.controller.ts index 2ce02c8792..d50272073f 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/downgrade-io/main.controller.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/downgrade-io/main.controller.ts @@ -5,8 +5,8 @@ export class MainController { heroes = [ new Hero(2, 'Superman'), new Hero(3, 'Spiderman') - ] - onDelete(hero:Hero) { + ]; + onDelete(hero: Hero) { hero.name = 'Ex-' + hero.name; } } diff --git a/public/docs/_examples/upgrade-adapter/ts/app/hero-detail.directive.ts b/public/docs/_examples/upgrade-adapter/ts/app/hero-detail.directive.ts index 8f595ba38f..e1b14d2dfc 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/hero-detail.directive.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/hero-detail.directive.ts @@ -18,5 +18,5 @@ export function heroDetailDirective() { }; }, controllerAs: 'ctrl' - } + }; } diff --git a/public/docs/_examples/upgrade-adapter/ts/app/hero.ts b/public/docs/_examples/upgrade-adapter/ts/app/hero.ts index 172d393139..5dcb5664eb 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/hero.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/hero.ts @@ -1,5 +1,5 @@ export class Hero { - constructor(public id:number, - public name:string, - public description?:string) { } + constructor(public id: number, + public name: string, + public description?: string) { } } diff --git a/public/docs/_examples/upgrade-adapter/ts/app/upgrade-io/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/upgrade-io/app.module.ts index dd2df20bdf..7e672c888c 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/upgrade-io/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/upgrade-io/app.module.ts @@ -3,7 +3,7 @@ import { ContainerComponent } from './container.component'; import { upgradeAdapter } from './upgrade_adapter'; -declare var angular:any; +declare var angular: any; angular.module('heroApp', []) .component('heroDetail', heroDetail) diff --git a/public/docs/_examples/upgrade-adapter/ts/app/upgrade-io/container.component.ts b/public/docs/_examples/upgrade-adapter/ts/app/upgrade-io/container.component.ts index 692e3f206f..0055370ea8 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/upgrade-io/container.component.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/upgrade-io/container.component.ts @@ -17,7 +17,7 @@ const HeroDetail = upgradeAdapter.upgradeNg1Component('heroDetail'); }) export class ContainerComponent { hero = new Hero(1, 'Windstorm'); - heroDeleted(hero:Hero) { + heroDeleted(hero: Hero) { hero.name = 'Ex-' + hero.name; } } diff --git a/public/docs/_examples/upgrade-adapter/ts/app/upgrade-static/app.module.ts b/public/docs/_examples/upgrade-adapter/ts/app/upgrade-static/app.module.ts index dd2df20bdf..7e672c888c 100644 --- a/public/docs/_examples/upgrade-adapter/ts/app/upgrade-static/app.module.ts +++ b/public/docs/_examples/upgrade-adapter/ts/app/upgrade-static/app.module.ts @@ -3,7 +3,7 @@ import { ContainerComponent } from './container.component'; import { upgradeAdapter } from './upgrade_adapter'; -declare var angular:any; +declare var angular: any; angular.module('heroApp', []) .component('heroDetail', heroDetail) diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/app.animations.ts b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/app.animations.ts index 4af94f3d37..f0739b6405 100644 --- a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/app.animations.ts +++ b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/app.animations.ts @@ -9,7 +9,7 @@ angular. }; function animateIn(element: JQuery, className: string, done: () => void) { - if (className !== 'selected') return; + if (className !== 'selected') { return; } element.css({ display: 'block', @@ -21,12 +21,12 @@ angular. }, done); return function animateInEnd(wasCanceled: boolean) { - if (wasCanceled) element.stop(); + if (wasCanceled) { element.stop(); } }; } function animateOut(element: JQuery, className: string, done: () => void) { - if (className !== 'selected') return; + if (className !== 'selected') { return; } element.css({ position: 'absolute', @@ -37,7 +37,7 @@ angular. }, done); return function animateOutEnd(wasCanceled: boolean) { - if (wasCanceled) element.stop(); + if (wasCanceled) { element.stop(); } }; } }); diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/app.config.ts b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/app.config.ts index 57f37b9d1f..1d16f67fbe 100644 --- a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/app.config.ts +++ b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/app.config.ts @@ -1,7 +1,7 @@ // #docregion angular. module('phonecatApp'). - config(['$locationProvider' ,'$routeProvider', + config(['$locationProvider', '$routeProvider', function config($locationProvider: angular.ILocationProvider, $routeProvider: angular.route.IRouteProvider) { $locationProvider.hashPrefix('!'); diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/core/phone/phone.service.spec.ts b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/core/phone/phone.service.spec.ts index 3b6962dd59..312036d71d 100644 --- a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/core/phone/phone.service.spec.ts +++ b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/core/phone/phone.service.spec.ts @@ -1,8 +1,8 @@ 'use strict'; describe('Phone', () => { - let $httpBackend:angular.IHttpBackendService; - let Phone:any; + let $httpBackend: angular.IHttpBackendService; + let Phone: any; let phonesData = [ {name: 'Phone X'}, {name: 'Phone Y'}, @@ -18,7 +18,7 @@ describe('Phone', () => { beforeEach(angular.mock.module('core.phone')); // Instantiate the service and "train" `$httpBackend` before each test - beforeEach(inject(function(_$httpBackend_:angular.IHttpBackendService, _Phone_:any) { + beforeEach(inject(function(_$httpBackend_: angular.IHttpBackendService, _Phone_: any) { $httpBackend = _$httpBackend_; $httpBackend.expectGET('phones/phones.json').respond(phonesData); @@ -32,7 +32,7 @@ describe('Phone', () => { }); it('should fetch the phones data from `/phones/phones.json`', () => { - var phones = Phone.query(); + let phones = Phone.query(); expect(phones).toEqual([]); diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/phone-detail/phone-detail.component.spec.ts b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/phone-detail/phone-detail.component.spec.ts index 15ff4a2464..0998b638f0 100644 --- a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/phone-detail/phone-detail.component.spec.ts +++ b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/app/phone-detail/phone-detail.component.spec.ts @@ -6,7 +6,7 @@ describe('phoneDetail', () => { // Test the controller describe('PhoneDetailController', () => { - let $httpBackend: angular.IHttpBackendService + let $httpBackend: angular.IHttpBackendService; let ctrl: any; let xyzPhoneData = { name: 'phone xyz', diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/app.animations.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/app.animations.ts index 4af94f3d37..f0739b6405 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/app.animations.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/app.animations.ts @@ -9,7 +9,7 @@ angular. }; function animateIn(element: JQuery, className: string, done: () => void) { - if (className !== 'selected') return; + if (className !== 'selected') { return; } element.css({ display: 'block', @@ -21,12 +21,12 @@ angular. }, done); return function animateInEnd(wasCanceled: boolean) { - if (wasCanceled) element.stop(); + if (wasCanceled) { element.stop(); } }; } function animateOut(element: JQuery, className: string, done: () => void) { - if (className !== 'selected') return; + if (className !== 'selected') { return; } element.css({ position: 'absolute', @@ -37,7 +37,7 @@ angular. }, done); return function animateOutEnd(wasCanceled: boolean) { - if (wasCanceled) element.stop(); + if (wasCanceled) { element.stop(); } }; } }); diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/app.config.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/app.config.ts index 72bbb2de49..458ed94250 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/app.config.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/app.config.ts @@ -2,8 +2,8 @@ angular. module('phonecatApp'). - config(['$locationProvider' ,'$routeProvider', - function config($locationProvider:angular.ILocationProvider, + config(['$locationProvider', '$routeProvider', + function config($locationProvider: angular.ILocationProvider, $routeProvider: angular.route.IRouteProvider) { $locationProvider.hashPrefix('!'); diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/core/phone/phone.service.spec.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/core/phone/phone.service.spec.ts index 9fe842a4e4..2849dfa8b0 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/core/phone/phone.service.spec.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/core/phone/phone.service.spec.ts @@ -16,13 +16,13 @@ import { MockBackend, MockConnection } from '@angular/http/testing'; import { Phone, PhoneData } from './phone.service'; describe('Phone', function() { - let phone:Phone; - let phonesData:PhoneData[] = [ + let phone: Phone; + let phonesData: PhoneData[] = [ {name: 'Phone X', snippet: '', images: []}, {name: 'Phone Y', snippet: '', images: []}, {name: 'Phone Z', snippet: '', images: []} ]; - let mockBackend:MockBackend; + let mockBackend: MockBackend; beforeEachProviders(() => [ Phone, @@ -36,7 +36,7 @@ describe('Phone', function() { ]); beforeEach(inject([MockBackend, Phone], - (_mockBackend_:MockBackend, _phone_:Phone) => { + (_mockBackend_: MockBackend, _phone_: Phone) => { mockBackend = _mockBackend_; phone = _phone_; })); diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.spec.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.spec.ts index 67809b486a..6affef51de 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.spec.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.spec.ts @@ -17,16 +17,16 @@ import { import { PhoneDetailComponent } from './phone-detail.component'; import { Phone, PhoneData } from '../core/phone/phone.service'; -function xyzPhoneData():PhoneData { +function xyzPhoneData(): PhoneData { return { name: 'phone xyz', snippet: '', images: ['image/url1.png', 'image/url2.png'] - } + }; } class MockPhone extends Phone { - get(id: string):Observable { + get(id: string): Observable { return Observable.of(xyzPhoneData()); } } diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ts index 3f42ba3044..bae7fd2ecf 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ts @@ -15,7 +15,7 @@ import { CheckmarkPipe } from '../core/checkmark/checkmark.pipe'; // #docregion initialclass }) // #enddocregion checkmark-pipe -export class PhoneDetailComponent{ +export class PhoneDetailComponent { phone: PhoneData; mainImageUrl: string; diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.spec.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.spec.ts index d050615923..80c1a39e9f 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.spec.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.spec.ts @@ -17,14 +17,14 @@ import { PhoneListComponent } from './phone-list.component'; import { Phone, PhoneData } from '../core/phone/phone.service'; class MockPhone extends Phone { - query():Observable { + query(): Observable { console.log('mocking here'); return Observable.of( [ {name: 'Nexus S', snippet: '', images: []}, {name: 'Motorola DROID', snippet: '', images: []} ] - ) + ); } } diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.ts b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.ts index a8b16c123f..5acd35758b 100644 --- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.ts +++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-list/phone-list.component.ts @@ -9,7 +9,7 @@ import { Phone, PhoneData } from '../core/phone/phone.service'; }) export class PhoneListComponent { phones: PhoneData[]; - query:string; + query: string; orderProp: string; constructor(phone: Phone) { @@ -21,7 +21,7 @@ export class PhoneListComponent { // #enddocregion initialclass // #docregion getphones - getPhones():PhoneData[] { + getPhones(): PhoneData[] { return this.sortPhones(this.filterPhones(this.phones)); } diff --git a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/app.component.ts b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/app.component.ts index 8f7ebd2ef4..af4e91c80f 100644 --- a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/app.component.ts +++ b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/app.component.ts @@ -5,9 +5,9 @@ import { PhoneListComponent } from './phone-list/phone-list.component'; import { PhoneDetailComponent } from './phone-detail/phone-detail.component'; @RouteConfig([ - {path:'/phones', name: 'Phones', component: PhoneListComponent}, - {path:'/phones/:phoneId', name: 'Phone', component: PhoneDetailComponent}, - {path:'/', redirectTo: ['Phones']} + {path: '/phones', name: 'Phones', component: PhoneListComponent}, + {path: '/phones/:phoneId', name: 'Phone', component: PhoneDetailComponent}, + {path: '/', redirectTo: ['Phones']} ]) @Component({ selector: 'phonecat-app', diff --git a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/core/phone/phone.service.spec.ts b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/core/phone/phone.service.spec.ts index ab664dc4c8..c9f511913b 100644 --- a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/core/phone/phone.service.spec.ts +++ b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/core/phone/phone.service.spec.ts @@ -15,13 +15,13 @@ import { MockBackend, MockConnection } from '@angular/http/testing'; import { Phone, PhoneData } from './phone.service'; describe('Phone', function() { - let phone:Phone; - let phonesData:PhoneData[] = [ + let phone: Phone; + let phonesData: PhoneData[] = [ {name: 'Phone X', snippet: '', images: []}, {name: 'Phone Y', snippet: '', images: []}, {name: 'Phone Z', snippet: '', images: []} ]; - let mockBackend:MockBackend; + let mockBackend: MockBackend; beforeEachProviders(() => [ Phone, @@ -33,7 +33,7 @@ describe('Phone', function() { } ]); - beforeEach(inject([MockBackend, Phone], (_mockBackend_:MockBackend, _phone_:Phone) => { + beforeEach(inject([MockBackend, Phone], (_mockBackend_: MockBackend, _phone_: Phone) => { mockBackend = _mockBackend_; phone = _phone_; })); diff --git a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-detail/phone-detail.component.spec.ts b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-detail/phone-detail.component.spec.ts index c553df3d29..79b3cddcfb 100644 --- a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-detail/phone-detail.component.spec.ts +++ b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-detail/phone-detail.component.spec.ts @@ -21,16 +21,16 @@ import { import { PhoneDetailComponent } from './phone-detail.component'; import { Phone, PhoneData } from '../core/phone/phone.service'; -function xyzPhoneData():PhoneData { +function xyzPhoneData(): PhoneData { return { name: 'phone xyz', snippet: '', images: ['image/url1.png', 'image/url2.png'] - } + }; } class MockPhone extends Phone { - get(id: string):Observable { + get(id: string): Observable { return Observable.of(xyzPhoneData()); } } diff --git a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-detail/phone-detail.component.ts b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-detail/phone-detail.component.ts index 5e29057023..36db78632c 100644 --- a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-detail/phone-detail.component.ts +++ b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-detail/phone-detail.component.ts @@ -10,7 +10,7 @@ import { CheckmarkPipe } from '../core/checkmark/checkmark.pipe'; templateUrl: 'phone-detail/phone-detail.template.html', pipes: [ CheckmarkPipe ] }) -export class PhoneDetailComponent{ +export class PhoneDetailComponent { phone: PhoneData; mainImageUrl: string; diff --git a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-list/phone-list.component.spec.ts b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-list/phone-list.component.spec.ts index bfdde7e1fc..3e0f5f1943 100644 --- a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-list/phone-list.component.spec.ts +++ b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-list/phone-list.component.spec.ts @@ -1,6 +1,6 @@ // #docregion routestuff import { ApplicationRef } from '@angular/core'; -import { LocationStrategy, HashLocationStrategy } from '@angular/common'; +import { LocationStrategy } from '@angular/common'; import { HTTP_PROVIDERS } from '@angular/http'; import { ROUTER_PROVIDERS, @@ -29,11 +29,11 @@ import { Phone, PhoneData } from '../core/phone/phone.service'; class MockPhone extends Phone { - query():Observable { + query(): Observable { return Observable.of([ {name: 'Nexus S', snippet: '', images: []}, {name: 'Motorola DROID', snippet: '', images: []} - ]) + ]); } } diff --git a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-list/phone-list.component.ts b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-list/phone-list.component.ts index 1ea6219031..352c433838 100644 --- a/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-list/phone-list.component.ts +++ b/public/docs/_examples/upgrade-phonecat-3-final/ts/app/phone-list/phone-list.component.ts @@ -12,7 +12,7 @@ import { Phone, PhoneData } from '../core/phone/phone.service'; // #enddocregion top export class PhoneListComponent { phones: PhoneData[]; - query:string; + query: string; orderProp: string; constructor(phone: Phone) { @@ -24,7 +24,7 @@ export class PhoneListComponent { // #enddocregion initialclass // #docregion getphones - getPhones():PhoneData[] { + getPhones(): PhoneData[] { return this.sortPhones(this.filterPhones(this.phones)); } diff --git a/public/docs/_examples/user-input/e2e-spec.ts b/public/docs/_examples/user-input/e2e-spec.ts index 22f8d96f63..a57a6ab33c 100644 --- a/public/docs/_examples/user-input/e2e-spec.ts +++ b/public/docs/_examples/user-input/e2e-spec.ts @@ -20,7 +20,7 @@ describe('User Input Tests', function () { expect(mainEle.getText()).not.toContain('Event target is '); buttonEle.click().then(function() { expect(mainEle.getText()).toContain('Event target is BUTTON'); - }) + }); }); it('should support the keyup event ', function () { @@ -28,7 +28,7 @@ describe('User Input Tests', function () { let inputEle = mainEle.element(by.css('input')); let outputTextEle = mainEle.element(by.css('p')); expect(outputTextEle.getText()).toEqual(''); - return sendKeys(inputEle,'abc').then(function() { + return sendKeys(inputEle, 'abc').then(function() { expect(outputTextEle.getText()).toEqual('a | ab | abc |'); }); }); @@ -38,7 +38,7 @@ describe('User Input Tests', function () { let inputEle = mainEle.element(by.css('input')); let outputTextEle = mainEle.element(by.css('p')); expect(outputTextEle.getText()).toEqual(''); - return sendKeys(inputEle,'abc').then(function() { + return sendKeys(inputEle, 'abc').then(function() { expect(outputTextEle.getText()).toEqual('abc'); }); }); @@ -48,7 +48,7 @@ describe('User Input Tests', function () { let inputEle = mainEle.element(by.css('input')); let outputTextEle = mainEle.element(by.css('p')); expect(outputTextEle.getText()).toEqual(''); - return sendKeys(inputEle,'abc').then(function() { + return sendKeys(inputEle, 'abc').then(function() { expect(outputTextEle.getText()).toEqual('a | ab | abc |'); }); }); @@ -58,7 +58,7 @@ describe('User Input Tests', function () { let inputEle = mainEle.element(by.css('input')); let outputTextEle = mainEle.element(by.css('p')); expect(outputTextEle.getText()).toEqual(''); - return sendKeys(inputEle,'abc').then(function() { + return sendKeys(inputEle, 'abc').then(function() { expect(outputTextEle.getText()).toEqual('', 'should be blank - have not sent enter yet'); return sendKeys(inputEle, protractor.Key.ENTER); }).then(function() { @@ -72,7 +72,7 @@ describe('User Input Tests', function () { let inputEle = mainEle.element(by.css('input')); let outputTextEle = mainEle.element(by.css('p')); expect(outputTextEle.getText()).toEqual(''); - return sendKeys(inputEle,'abc').then(function() { + return sendKeys(inputEle, 'abc').then(function() { expect(outputTextEle.getText()).toEqual('', 'should be blank - have not sent enter yet'); // change the focus return prevInputEle.click(); diff --git a/public/docs/_examples/user-input/ts/app/click-me.component.ts b/public/docs/_examples/user-input/ts/app/click-me.component.ts index 20e77ad427..45a4ca7e70 100644 --- a/public/docs/_examples/user-input/ts/app/click-me.component.ts +++ b/public/docs/_examples/user-input/ts/app/click-me.component.ts @@ -17,8 +17,8 @@ import { Component } from '@angular/core'; export class ClickMeComponent { clickMessage = ''; - onClickMe(){ - this.clickMessage ='You are my hero!'; + onClickMe() { + this.clickMessage = 'You are my hero!'; } } // #enddocregion click-me-component diff --git a/public/docs/_examples/user-input/ts/app/click-me2.component.ts b/public/docs/_examples/user-input/ts/app/click-me2.component.ts index b444e3594e..efd3be2753 100644 --- a/public/docs/_examples/user-input/ts/app/click-me2.component.ts +++ b/public/docs/_examples/user-input/ts/app/click-me2.component.ts @@ -11,8 +11,8 @@ export class ClickMeComponent2 { clickMessage = ''; clicks = 1; - onClickMe2(event:any){ - let evtMsg = event ? ' Event target is '+ event.target.tagName : ''; - this.clickMessage = (`Click #${this.clicks++}. ${evtMsg}`) + onClickMe2(event: any) { + let evtMsg = event ? ' Event target is ' + event.target.tagName : ''; + this.clickMessage = (`Click #${this.clicks++}. ${evtMsg}`); } } diff --git a/public/docs/_examples/user-input/ts/app/keyup.components.ts b/public/docs/_examples/user-input/ts/app/keyup.components.ts index c4acf742f5..79736c8a4c 100644 --- a/public/docs/_examples/user-input/ts/app/keyup.components.ts +++ b/public/docs/_examples/user-input/ts/app/keyup.components.ts @@ -1,3 +1,4 @@ +/* tslint:disable:class-name component-class-suffix */ // #docplaster // #docregion import { Component } from '@angular/core'; @@ -14,7 +15,7 @@ import { Component } from '@angular/core'; }) // #docregion key-up-component-1-class, key-up-component-1-class-no-type export class KeyUpComponent_v1 { - values=''; + values = ''; // #enddocregion key-up-component-1-class, key-up-component-1-class-no-type /* @@ -27,7 +28,7 @@ export class KeyUpComponent_v1 { */ // #docregion key-up-component-1-class // with strong typing - onKey(event:KeyboardEvent) { + onKey(event: KeyboardEvent) { this.values += (event.target).value + ' | '; } // #docregion key-up-component-1-class-no-type @@ -45,8 +46,8 @@ export class KeyUpComponent_v1 { ` }) export class KeyUpComponent_v2 { - values=''; - onKey(value:string) { + values = ''; + onKey(value: string) { this.values += value + ' | '; } } @@ -64,7 +65,7 @@ export class KeyUpComponent_v2 { ` }) export class KeyUpComponent_v3 { - values=''; + values = ''; } // #enddocregion key-up-component-3 @@ -83,6 +84,6 @@ export class KeyUpComponent_v3 { ` }) export class KeyUpComponent_v4 { - values=''; + values = ''; } // #enddocregion key-up-component-4 diff --git a/public/docs/_examples/user-input/ts/app/little-tour.component.ts b/public/docs/_examples/user-input/ts/app/little-tour.component.ts index f48abe3518..8dd3ebf216 100644 --- a/public/docs/_examples/user-input/ts/app/little-tour.component.ts +++ b/public/docs/_examples/user-input/ts/app/little-tour.component.ts @@ -15,8 +15,8 @@ import { Component } from '@angular/core'; ` }) export class LittleTourComponent { - heroes=['Windstorm', 'Bombasto', 'Magneta', 'Tornado']; - addHero(newHero:string) { + heroes = ['Windstorm', 'Bombasto', 'Magneta', 'Tornado']; + addHero(newHero: string) { if (newHero) { this.heroes.push(newHero); } diff --git a/public/docs/_examples/user-input/ts/app/loop-back.component.ts b/public/docs/_examples/user-input/ts/app/loop-back.component.ts index f7c15f36bf..6c9dad1da8 100644 --- a/public/docs/_examples/user-input/ts/app/loop-back.component.ts +++ b/public/docs/_examples/user-input/ts/app/loop-back.component.ts @@ -3,7 +3,7 @@ import { Component } from '@angular/core'; // #docregion loop-back-component @Component({ selector: 'loop-back', - template:` + template: `

      {{box.value}}

      ` diff --git a/tslint.json b/tslint.json index 490c4bd51d..0455f476ed 100644 --- a/tslint.json +++ b/tslint.json @@ -102,6 +102,7 @@ "use-life-cycle-interface": true, "use-pipe-transform-interface": true, "component-class-suffix": true, - "directive-class-suffix": true + "directive-class-suffix": true, + "import-destructuring-spacing": true } }