'
})
// #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 8111893260..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,9 +6,8 @@ import { HeroService } from './heroes/hero.service.1';
bootstrap(AppComponent);
function discouraged() {
- //#docregion bootstrap
+ // #docregion bootstrap-discouraged
bootstrap(AppComponent,
- [HeroService]); // DISCOURAGED (but works)不推荐(但可用)
- //#enddocregion bootstrap
+ [HeroService]); // DISCOURAGED (but works)
+ // #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/dart-snippets/app_component_snippets_pt1.dart b/public/docs/_examples/toh-1/dart-snippets/app_component_snippets_pt1.dart
index b3a4e60eaf..8b21290440 100644
--- a/public/docs/_examples/toh-1/dart-snippets/app_component_snippets_pt1.dart
+++ b/public/docs/_examples/toh-1/dart-snippets/app_component_snippets_pt1.dart
@@ -25,7 +25,7 @@ template: '''
`
diff --git a/public/docs/dart/latest/tutorial/index.jade b/public/docs/dart/latest/tutorial/index.jade
index 3959d10676..4cceeeb572 100644
--- a/public/docs/dart/latest/tutorial/index.jade
+++ b/public/docs/dart/latest/tutorial/index.jade
@@ -2,8 +2,7 @@ include ../_util-fns
+includeShared('{ts}', 'intro')
-:marked
- [View the source code](https://github.com/angular/angular.io/tree/master/public/docs/_examples/toh-5/dart)
+p Run the #[+liveExampleLink2('', 'toh-5')].
+includeShared('{ts}', 'main')
diff --git a/public/docs/dart/latest/tutorial/toh-pt1.jade b/public/docs/dart/latest/tutorial/toh-pt1.jade
index e96613a628..a600cea7d6 100644
--- a/public/docs/dart/latest/tutorial/toh-pt1.jade
+++ b/public/docs/dart/latest/tutorial/toh-pt1.jade
@@ -34,15 +34,13 @@ include ../_util-fns
.callout.is-helpful
header Source code
- :marked
- The complete source code for the example app in this chapter is
- [in GitHub](https://github.com/angular/angular.io/tree/master/public/docs/_examples/toh-1/dart).
+ p Run the #[+liveExampleLink2('', 'toh-1')] for this part.
:marked
## Keep the app compiling and running
We want to start the Dart compiler, have it watch for changes, and start our server. We'll do this by typing
-code-example(format="" language="bash").
+code-example(language="bash").
pub serve
:marked
@@ -87,7 +85,7 @@ code-example(format="" language="bash").
Now that we have a `Hero` class, let’s refactor our component’s `hero` property to be of type `Hero`.
Then initialize it with an id of `1` and the name, "Windstorm".
-+makeExample('toh-1/dart-snippets/app_component_snippets_pt1.dart', 'hero-property-1', 'app_component.dart (Hero property)')(format=".")
++makeExample('toh-1/dart/lib/app_component.dart', 'hero-property-1', 'app_component.dart (hero property)')(format=".")
:marked
Because we changed the hero from a string to an object,
diff --git a/public/docs/dart/latest/tutorial/toh-pt2.jade b/public/docs/dart/latest/tutorial/toh-pt2.jade
index 8a6d7405f1..1c563e9100 100644
--- a/public/docs/dart/latest/tutorial/toh-pt2.jade
+++ b/public/docs/dart/latest/tutorial/toh-pt2.jade
@@ -12,9 +12,7 @@ include ../_util-fns
.callout.is-helpful
header Source code
- :marked
- The complete source code for the example app in this chapter is
- [in GitHub](https://github.com/angular/angular.io/tree/master/public/docs/_examples/toh-2/dart).
+ p Run the #[+liveExampleLink2('', 'toh-2')] for this part.
.l-main-section
:marked
@@ -38,7 +36,7 @@ include ../_util-fns
### Keep the app compiling and running
We want to start the Dart compiler, have it watch for changes, and start our server. We'll do this by typing
-code-example(format="." language="bash").
+code-example(language="bash").
pub serve
:marked
diff --git a/public/docs/dart/latest/tutorial/toh-pt3.jade b/public/docs/dart/latest/tutorial/toh-pt3.jade
index 63a421eb6b..3c4a961b77 100644
--- a/public/docs/dart/latest/tutorial/toh-pt3.jade
+++ b/public/docs/dart/latest/tutorial/toh-pt3.jade
@@ -4,8 +4,7 @@ include ../_util-fns
Our app is growing.
Use cases are flowing in for reusing components, passing data to components, and creating more reusable assets. Let's separate the heroes list from the hero details and make the details component reusable.
- The complete source code for the example app in this chapter is
- [in GitHub](https://github.com/angular/angular.io/tree/master/public/docs/_examples/toh-3/dart).
+p Run the #[+liveExampleLink2('', 'toh-3')] for this part.
.l-main-section
:marked
diff --git a/public/docs/dart/latest/tutorial/toh-pt4.jade b/public/docs/dart/latest/tutorial/toh-pt4.jade
index 238f23e06f..e84d25db18 100644
--- a/public/docs/dart/latest/tutorial/toh-pt4.jade
+++ b/public/docs/dart/latest/tutorial/toh-pt4.jade
@@ -15,8 +15,7 @@ include ../_util-fns
Because data services are invariably asynchronous,
we'll finish the chapter with a promise-based version of the data service.
- The complete source code for the example app in this chapter is
- [in GitHub](https://github.com/angular/angular.io/tree/master/public/docs/_examples/toh-4/dart).
+p Run the #[+liveExampleLink2('', 'toh-4')] for this part.
.l-main-section
:marked
@@ -42,7 +41,7 @@ include ../_util-fns
Open a terminal/console window.
Start the Dart compiler, watch for changes, and start our server by entering the command:
-code-example(format="." language="bash").
+code-example(language="bash").
pub serve
:marked
diff --git a/public/docs/dart/latest/tutorial/toh-pt5.jade b/public/docs/dart/latest/tutorial/toh-pt5.jade
index dda232bed8..11cde4b710 100644
--- a/public/docs/dart/latest/tutorial/toh-pt5.jade
+++ b/public/docs/dart/latest/tutorial/toh-pt5.jade
@@ -17,9 +17,8 @@ figure.image-display
:marked
The [Routing and Navigation](../guide/router.html) chapter covers the router in more detail
than we will in this tour.
-:marked
- The complete source code for the example app in this chapter is
- [in GitHub](https://github.com/angular/angular.io/tree/master/public/docs/_examples/toh-5/dart).
+
+p Run the #[+liveExampleLink2('', 'toh-5')] for this part.
.l-main-section
:marked
@@ -48,7 +47,7 @@ figure.image-display
Open a terminal/console window.
Start the Dart compiler, watch for changes, and start our server by entering the command:
-code-example(format="." language="bash").
+code-example(language="bash").
pub serve
:marked
diff --git a/public/docs/ts/latest/tutorial/index.jade b/public/docs/ts/latest/tutorial/index.jade
index d3f899e19a..d96733d696 100644
--- a/public/docs/ts/latest/tutorial/index.jade
+++ b/public/docs/ts/latest/tutorial/index.jade
@@ -45,10 +45,10 @@ include ../_util-fns
// #enddocregion intro
-:marked
- [Run the live example](/resources/live-examples/toh-6/ts/plnkr.html)
+p Run the #[+liveExampleLink2('', 'toh-6')].
+
+p 运行这部分的#[+liveExampleLink2('在线例子', 'toh-6')]。
- [运行在线例子](/resources/live-examples/toh-6/ts/plnkr.html)
// #docregion main
.l-main-section
:marked
diff --git a/public/docs/ts/latest/tutorial/toh-pt1.jade b/public/docs/ts/latest/tutorial/toh-pt1.jade
index 001b869170..5d3488c82e 100644
--- a/public/docs/ts/latest/tutorial/toh-pt1.jade
+++ b/public/docs/ts/latest/tutorial/toh-pt1.jade
@@ -8,10 +8,11 @@ include ../_util-fns
每一个故事,都有一个起点。而我们的故事则开始于[“快速起步”](../quickstart.html)的结尾处。
- [Run the live example for part 1](/resources/live-examples/toh-1/ts/plnkr.html)
-
- [运行第一部分的在线例子](/resources/live-examples/toh-1/ts/plnkr.html)
+p Run the #[+liveExampleLink2('', 'toh-1')] for this part.
+p 运行这部分的#[+liveExampleLink2('在线例子', 'toh-1')]。
+
+:marked
Create a folder called `angular2-tour-of-heroes` and follow the [QuickStart](../quickstart.html) steps
which provide the prerequisites, the folder structure, and the core files for our Tour of Heroes.
@@ -45,7 +46,7 @@ include ../_quickstart_repo
我们要启动TypeScript编译器,它会监视文件变更,并且启动开发服务器。我们只要敲:
-code-example(format="" language="bash").
+code-example(language="bash").
npm start
:marked
@@ -258,10 +259,11 @@ code-example(language="html").
* The `ngModel` directive also propagates changes to every other binding of the `hero.name`.
* 通过`ngModel`指令,这些修改还影响到了每一个对`hero.name`的其它绑定。
- [Run the live example for part 1](/resources/live-examples/toh-1/ts/plnkr.html)
-
- [运行第一部分的在线例子](/resources/live-examples/toh-1/ts/plnkr.html)
+p Run the #[+liveExampleLink2('', 'toh-1')] for this part.
+p 运行这部分的#[+liveExampleLink2('在线例子', 'toh-1')]。
+
+:marked
Here's the complete `app.component.ts` as it stands now:
完整的`app.component.ts`是这样的:
diff --git a/public/docs/ts/latest/tutorial/toh-pt2.jade b/public/docs/ts/latest/tutorial/toh-pt2.jade
index 8c72b5d3fe..d40832cdd4 100644
--- a/public/docs/ts/latest/tutorial/toh-pt2.jade
+++ b/public/docs/ts/latest/tutorial/toh-pt2.jade
@@ -9,10 +9,11 @@ include ../_util-fns
我们的故事需要更多的英雄了。我们将扩展这个《英雄指南》,来显示一个英雄列表,允许用户选择一个英雄,并且显示英雄的详情。
- [Run the live example for part 2](/resources/live-examples/toh-2/ts/plnkr.html)
-
- [运行第二部分的在线例子](/resources/live-examples/toh-2/ts/plnkr.html)
+p Run the #[+liveExampleLink2('', 'toh-2')] for this part.
+p 运行这部分的#[+liveExampleLink2('在线例子', 'toh-2')]。
+
+:marked
Let’s take stock of what we’ll need to display a list of heroes.
First, we need a list of heroes. We want to display those heroes in the view’s template,
so we’ll need a way to do that.
@@ -52,7 +53,7 @@ include ../_util-fns
我们要启动TypeScript编译器,它会监视文件变更,并启动开发服务器。我们只要敲:
-code-example(format="." language="bash").
+code-example(language="bash").
npm start
:marked
@@ -480,10 +481,11 @@ code-example(format="." language="bash").
* We learned how to use the built-in directives `ngIf` and `ngFor` in a component’s template
* 我们学会了如何在组件模板中使用内建的`ngIf`和`ngFor`指令
- [Run the live example for part 2](/resources/live-examples/toh-2/ts/plnkr.html)
-
- [运行第二部分的在线例子](/resources/live-examples/toh-2/ts/plnkr.html)
+p Run the #[+liveExampleLink2('', 'toh-2')] for this part.
+p 运行这部分的#[+liveExampleLink2('在线例子', 'toh-2')]。
+
+:marked
### The Road Ahead
### 前方的路
Our Tour of Heroes has grown, but it’s far from complete.
diff --git a/public/docs/ts/latest/tutorial/toh-pt3.jade b/public/docs/ts/latest/tutorial/toh-pt3.jade
index fd7358069d..3d6f54dc6d 100644
--- a/public/docs/ts/latest/tutorial/toh-pt3.jade
+++ b/public/docs/ts/latest/tutorial/toh-pt3.jade
@@ -7,9 +7,9 @@ include ../_util-fns
我们的应用继续成长。
这次的例子将依次展示:复用组件、给组件传入数据以及创建更容易复用的软件资产。我们先把英雄列表从英雄详情中分离出来,并且让详情组件可复用。
- [Run the live example for part 3](/resources/live-examples/toh-3/ts/plnkr.html)
-
- [运行第三部分的在线例子](/resources/live-examples/toh-3/ts/plnkr.html)
+p Run the #[+liveExampleLink2('', 'toh-3')] for this part.
+
+p 运行这部分的#[+liveExampleLink2('在线例子', 'toh-3')]。
.l-main-section
:marked
@@ -375,9 +375,9 @@ code-example(format=".").
* We learned to declare the application directives we need in a `directives` array.
* 我们学会了在`directives`中定义应用所需的指令。
- [Run the live example for part 3](/resources/live-examples/toh-3/ts/plnkr.html).
-
- [运行第三部分的在线例子](/resources/live-examples/toh-3/ts/plnkr.html).
+p Run the #[+liveExampleLink2('', 'toh-3')] for this part.
+
+p 运行这部分的#[+liveExampleLink2('在线例子', 'toh-3')]。
.l-main-section
:marked
diff --git a/public/docs/ts/latest/tutorial/toh-pt4.jade b/public/docs/ts/latest/tutorial/toh-pt4.jade
index 4162551dbe..abb5849339 100644
--- a/public/docs/ts/latest/tutorial/toh-pt4.jade
+++ b/public/docs/ts/latest/tutorial/toh-pt4.jade
@@ -25,10 +25,10 @@ include ../_util-fns
we'll finish the chapter with a promise-based version of the data service.
因为数据服务通常都是异步的,所以在本章的最后,我们会把它重构为基于承诺(Promise,一种异步编程模式)的版本。
-:marked
- [Run the live example for part 4](/resources/live-examples/toh-4/ts/plnkr.html)
- [运行第四部分的在线例子](/resources/live-examples/toh-4/ts/plnkr.html)
+p Run the #[+liveExampleLink2('', 'toh-4')] for this part.
+
+p 运行这部分的#[+liveExampleLink2('在线例子', 'toh-4')]。
.l-main-section
:marked
@@ -56,6 +56,7 @@ include ../_util-fns
.file systemjs.config.js
.file tsconfig.json
.file typings.json
+
:marked
### Keep the app transpiling and running
### 让应用代码保持转译和运行
@@ -64,7 +65,7 @@ include ../_util-fns
打开terminal/console窗口,启动TypeScript编译器,它会监视文件变更,并启动开发服务器。只要敲:
-code-example(format="." language="bash").
+code-example(language="bash").
npm start
:marked
@@ -551,10 +552,11 @@ a#child-component
* We designed our service to return a promise and our component to get our data from the promise
* 我们把服务改造为返回承诺的,并让组件从承诺获取数据
- [Run the live example for part 4](/resources/live-examples/toh-4/ts/plnkr.html)
-
- [运行第四部分的在线例子](/resources/live-examples/toh-4/ts/plnkr.html)
+p Run the #[+liveExampleLink2('', 'toh-4')] for this part.
+p 运行这部分的#[+liveExampleLink2('在线例子', 'toh-4')]。
+
+:marked
### The Road Ahead
### 前方的路
Our Tour of Heroes has become more reusable using shared components and services.
diff --git a/public/docs/ts/latest/tutorial/toh-pt5.jade b/public/docs/ts/latest/tutorial/toh-pt5.jade
index a3a2218a43..8a42e6efbb 100644
--- a/public/docs/ts/latest/tutorial/toh-pt5.jade
+++ b/public/docs/ts/latest/tutorial/toh-pt5.jade
@@ -30,10 +30,11 @@ figure.image-display
than we will in this tour.
[路由与导航](../guide/router-deprecated.html)一章覆盖了比该教程中更详细的路由知识。
-:marked
- [Run the live example](/resources/live-examples/toh-5/ts/plnkr.html).
-
- [运行在线例子](/resources/live-examples/toh-5/ts/plnkr.html).
+
+p Run the #[+liveExampleLink2('', 'toh-5')] for this part.
+
+p 运行这部分的#[+liveExampleLink2('在线例子', 'toh-5')]。
+
.l-sub-section
img(src='/resources/images/devguide/plunker-separate-window-button.png' alt="弹出窗口" align="right" style="margin-right:-20px")
:marked
@@ -77,7 +78,7 @@ figure.image-display
打开terminal/console窗口,运行下列命令启动TypeScript编译器,它会监视文件变更,并启动开发服务器:
-code-example(format="." language="bash").
+code-example(language="bash").
npm start
:marked
@@ -1091,13 +1092,18 @@ figure.image-display
.l-main-section
:marked
## Application structure and code
+
## 应用结构和代码
- Review the sample source code [in the live example for this chapter](/resources/live-examples/toh-5/ts/plnkr.html).
+p.
+ Review the sample source code in the #[+liveExampleLink2('', 'toh-5')] for this part.
Verify that we have the following structure:
-
- 在[本章的在线例子](/resources/live-examples/toh-5/ts/plnkr.html)中回顾范例代码。请验证一下我们已经有了下列结构:
+p.
+ 在#[+liveExampleLink2('在线例子', 'toh-5')]中回顾这部分代码。
+ 验证我们是否已经得到了下列结构:
+
+:marked
.filetree
.file angular2-tour-of-heroes
.children
diff --git a/public/docs/ts/latest/tutorial/toh-pt6.jade b/public/docs/ts/latest/tutorial/toh-pt6.jade
index 06f07ade49..7098025b0a 100644
--- a/public/docs/ts/latest/tutorial/toh-pt6.jade
+++ b/public/docs/ts/latest/tutorial/toh-pt6.jade
@@ -8,8 +8,8 @@ include ../_util-fns
and save these changes back to the server.
In this chapter we teach our application to make the corresponding http calls to a remote server's web api.
-:marked
- [Run the live example](/resources/live-examples/toh-6/ts/plnkr.html).
+
+p Run the #[+liveExampleLink2('', 'toh-6')] for this part.
.l-main-section
:marked
@@ -21,7 +21,7 @@ include ../_util-fns
Open a terminal/console window and enter the following command to
start the TypeScript compiler, start the server, and watch for changes:
-code-example(format="." language="bash").
+code-example(language="bash").
npm start
:marked
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
}
}