style(lint): re-format modules/@angular

This commit is contained in:
Alex Eagle
2016-06-08 16:38:52 -07:00
parent bbed364e7b
commit f39c9c9e75
589 changed files with 21829 additions and 24259 deletions
@@ -1,5 +1,6 @@
import {MaxLengthValidator, MinLengthValidator} from '@angular/common';
import {Component} from '@angular/core';
import {MinLengthValidator, MaxLengthValidator} from '@angular/common';
// #docregion min
@Component({
@@ -1,6 +1,6 @@
import {UrlResolver} from '@angular/compiler';
import {provide} from '@angular/core';
import {bootstrap} from '@angular/platform-browser';
import {UrlResolver} from '@angular/compiler';
var MyApp: any;
@@ -1,8 +1,8 @@
// #docregion Component
import {Component, trigger, state, animate, transition, style} from '@angular/core';
import {Component, animate, state, style, transition, trigger} from '@angular/core';
@Component({
selector: "my-expando",
selector: 'my-expando',
styles: [`
.toggle-container {
background-color:white;
@@ -15,18 +15,14 @@ import {Component, trigger, state, animate, transition, style} from '@angular/co
overflow:hidden;
}
`],
animations: [
trigger('openClose', [
state('collapsed, void',
style({ height:"0px", color: "maroon", borderColor: "maroon" })),
state('expanded',
style({ height:"*", borderColor:"green", color:"green" })),
transition("collapsed <=> expanded", [
animate(500, style({ height: '250px'})),
animate(500)
])
])
],
animations: [trigger(
'openClose',
[
state('collapsed, void', style({height: '0px', color: 'maroon', borderColor: 'maroon'})),
state('expanded', style({height: '*', borderColor: 'green', color: 'green'})),
transition(
'collapsed <=> expanded', [animate(500, style({height: '250px'})), animate(500)])
])],
template: `
<button (click)="expand()">Open</button>
<button (click)="collapse()">Closed</button>
@@ -37,15 +33,9 @@ import {Component, trigger, state, animate, transition, style} from '@angular/co
`
})
export class MyExpandoCmp {
stateExpression:string;
constructor() {
this.collapse();
}
expand() {
this.stateExpression = 'expanded';
}
collapse() {
this.stateExpression = 'collapsed';
}
stateExpression: string;
constructor() { this.collapse(); }
expand() { this.stateExpression = 'expanded'; }
collapse() { this.stateExpression = 'collapsed'; }
}
// #enddocregion
@@ -1,10 +1,5 @@
import {
Inject,
ReflectiveInjector,
forwardRef,
resolveForwardRef,
ForwardRefFn
} from '@angular/core';
import {ForwardRefFn, Inject, ReflectiveInjector, forwardRef, resolveForwardRef} from '@angular/core';
// #docregion forward_ref_fn
var ref = forwardRef(() => Lock);
@@ -26,7 +21,7 @@ expect(door.lock instanceof Lock).toBe(true);
// #enddocregion
// #docregion resolve_forward_ref
var ref = forwardRef(() => "refValue");
expect(resolveForwardRef(ref)).toEqual("refValue");
expect(resolveForwardRef("regularValue")).toEqual("regularValue");
var ref = forwardRef(() => 'refValue');
expect(resolveForwardRef(ref)).toEqual('refValue');
expect(resolveForwardRef('regularValue')).toEqual('regularValue');
// #enddocregion
@@ -1,5 +1,5 @@
import {bootstrap} from '@angular/platform-browser';
import {NG_VALIDATORS} from '@angular/common';
import {bootstrap} from '@angular/platform-browser';
let MyApp: Function = null;
let myValidator: any = null;
@@ -27,7 +27,7 @@ export class AsyncPipeExample {
if (this.arrived) {
this.reset();
} else {
this.resolve("hi there!");
this.resolve('hi there!');
this.arrived = true;
}
}
@@ -35,7 +35,7 @@ export class AsyncPipeExample {
// #enddocregion
// #docregion AsyncPipeObservable
@Component({selector: "task-cmp", template: "Time: {{ time | async }}"})
@Component({selector: 'task-cmp', template: 'Time: {{ time | async }}'})
class Task {
time = new Observable<number>((observer: Subscriber<number>) => {
setInterval(() => observer.next(new Date().getTime()), 500);
@@ -1,4 +1,4 @@
import {Component, Attribute, Directive, Pipe} from '@angular/core';
import {Attribute, Component, Directive, Pipe} from '@angular/core';
var CustomDirective: Function;
@@ -1,5 +1,5 @@
import {Component, createPlatform, coreLoadAndBootstrap, ReflectiveInjector} from '@angular/core';
import {BROWSER_PLATFORM_PROVIDERS, BROWSER_APP_PROVIDERS} from '@angular/platform-browser';
import {Component, ReflectiveInjector, coreLoadAndBootstrap, createPlatform} from '@angular/core';
import {BROWSER_APP_PROVIDERS, BROWSER_PLATFORM_PROVIDERS} from '@angular/platform-browser';
var appProviders: any[] = [];
@@ -9,6 +9,7 @@ class MyApp {
}
var platform = createPlatform(ReflectiveInjector.resolveAndCreate(BROWSER_PLATFORM_PROVIDERS));
var appInjector = ReflectiveInjector.resolveAndCreate([BROWSER_APP_PROVIDERS, appProviders], platform.injector);
var appInjector =
ReflectiveInjector.resolveAndCreate([BROWSER_APP_PROVIDERS, appProviders], platform.injector);
coreLoadAndBootstrap(MyApp, appInjector);
// #enddocregion
@@ -1,7 +1,8 @@
// #docregion Observable
import {Observable, Subscriber} from 'rxjs/Rx';
import 'rxjs/add/operator/map';
import {Observable, Subscriber} from 'rxjs/Rx';
var obs = new Observable<number>((obs: Subscriber<any>) => {
var i = 0;
setInterval(() => obs.next(++i), 1000);
@@ -1,5 +1,5 @@
import {By} from '@angular/platform-browser';
import {DebugElement} from '@angular/core';
import {By} from '@angular/platform-browser';
var debugElement: DebugElement;
class MyDirective {}
@@ -1,5 +1,5 @@
import {Component} from "@angular/core";
import {ELEMENT_PROBE_PROVIDERS, bootstrap} from "@angular/platform-browser";
import {Component} from '@angular/core';
import {ELEMENT_PROBE_PROVIDERS, bootstrap} from '@angular/platform-browser';
@Component({selector: 'my-component'})
class MyAppComponent {
@@ -1,12 +1,7 @@
import {APP_BASE_HREF} from '@angular/common';
import {Component, ComponentRef} from '@angular/core';
import {bootstrap} from '@angular/platform-browser';
import {
CanActivate,
RouteConfig,
ComponentInstruction,
ROUTER_DIRECTIVES
} from '@angular/router-deprecated';
import {APP_BASE_HREF} from '@angular/common';
import {CanActivate, ComponentInstruction, ROUTER_DIRECTIVES, RouteConfig} from '@angular/router-deprecated';
function checkIfWeHavePermission(instruction: ComponentInstruction) {
return instruction.params['id'] == '1';
@@ -1,5 +1,5 @@
import {verifyNoBrowserErrors, browser} from '@angular/platform-browser/testing_e2e';
import {expect} from '@angular/core/testing';
import {browser, verifyNoBrowserErrors} from '@angular/platform-browser/testing_e2e';
function waitForElement(selector: string) {
var EC = (<any>protractor).ExpectedConditions;
@@ -1,13 +1,8 @@
import {provide, Component, ComponentRef} from '@angular/core';
import {bootstrap} from '@angular/platform-browser';
import {
CanDeactivate,
RouteConfig,
RouteParams,
ComponentInstruction,
ROUTER_DIRECTIVES
} from '@angular/router-deprecated';
import {APP_BASE_HREF} from '@angular/common';
import {Component, ComponentRef, provide} from '@angular/core';
import {bootstrap} from '@angular/platform-browser';
import {CanDeactivate, ComponentInstruction, ROUTER_DIRECTIVES, RouteConfig, RouteParams} from '@angular/router-deprecated';
// #docregion routerCanDeactivate
@Component({
@@ -1,5 +1,5 @@
import {verifyNoBrowserErrors, browser} from '@angular/platform-browser/testing_e2e';
import {expect} from '@angular/core/testing';
import {browser, verifyNoBrowserErrors} from '@angular/platform-browser/testing_e2e';
function waitForElement(selector: string) {
var EC = (<any>protractor).ExpectedConditions;
@@ -1,12 +1,8 @@
import {Component, provide, ComponentRef} from '@angular/core';
import {bootstrap} from '@angular/platform-browser';
import {
OnActivate,
ComponentInstruction,
RouteConfig,
ROUTER_DIRECTIVES
} from '@angular/router-deprecated';
import {APP_BASE_HREF} from '@angular/common';
import {Component, ComponentRef, provide} from '@angular/core';
import {bootstrap} from '@angular/platform-browser';
import {ComponentInstruction, OnActivate, ROUTER_DIRECTIVES, RouteConfig} from '@angular/router-deprecated';
// #docregion routerOnActivate
@Component({template: `Child`})
@@ -1,12 +1,7 @@
import {Component, Injectable, ComponentRef} from '@angular/core';
import {bootstrap} from '@angular/platform-browser';
import {
OnDeactivate,
ComponentInstruction,
RouteConfig,
ROUTER_DIRECTIVES
} from '@angular/router-deprecated';
import {APP_BASE_HREF} from '@angular/common';
import {Component, ComponentRef, Injectable} from '@angular/core';
import {bootstrap} from '@angular/platform-browser';
import {ComponentInstruction, OnDeactivate, ROUTER_DIRECTIVES, RouteConfig} from '@angular/router-deprecated';
@Injectable()
@@ -57,7 +52,6 @@ export class AppCmp {
export function main(): Promise<ComponentRef<AppCmp>> {
return bootstrap(AppCmp, [
{provide: APP_BASE_HREF, useValue: '/@angular/examples/router/ts/on_deactivate'},
LogService
{provide: APP_BASE_HREF, useValue: '/@angular/examples/router/ts/on_deactivate'}, LogService
]);
}
@@ -1,5 +1,5 @@
import {verifyNoBrowserErrors, browser} from '@angular/platform-browser/testing_e2e';
import {expect} from '@angular/core/testing';
import {browser, verifyNoBrowserErrors} from '@angular/platform-browser/testing_e2e';
function waitForElement(selector: string) {
var EC = (<any>protractor).ExpectedConditions;
@@ -1,14 +1,8 @@
import {APP_BASE_HREF} from '@angular/common';
import {Component, ComponentRef} from '@angular/core';
import {bootstrap} from '@angular/platform-browser';
import {
RouteConfig,
ComponentInstruction,
ROUTER_DIRECTIVES,
CanReuse,
RouteParams,
OnReuse
} from '@angular/router-deprecated';
import {APP_BASE_HREF} from '@angular/common';
import {CanReuse, ComponentInstruction, OnReuse, ROUTER_DIRECTIVES, RouteConfig, RouteParams} from '@angular/router-deprecated';
// #docregion reuseCmp
@@ -52,6 +46,6 @@ export class AppCmp {
export function main(): Promise<ComponentRef<AppCmp>> {
return bootstrap(AppCmp,
[{provide: APP_BASE_HREF, useValue: '/@angular/examples/router/ts/reuse'}]);
return bootstrap(
AppCmp, [{provide: APP_BASE_HREF, useValue: '/@angular/examples/router/ts/reuse'}]);
}
@@ -1,5 +1,5 @@
import {verifyNoBrowserErrors, browser} from '@angular/platform-browser/testing_e2e';
import {expect} from '@angular/core/testing';
import {browser, verifyNoBrowserErrors} from '@angular/platform-browser/testing_e2e';
function waitForElement(selector: string) {
var EC = (<any>protractor).ExpectedConditions;
@@ -1,4 +1,5 @@
import {describe, it, fakeAsync, expect, tick, clearPendingTimers} from '@angular/core/testing';
import {clearPendingTimers, describe, expect, fakeAsync, it, tick} from '@angular/core/testing';
// #docregion basic
describe('this test', () => {
+10 -16
View File
@@ -1,13 +1,4 @@
import {
describe,
xdescribe,
it,
xit,
beforeEach,
afterEach,
beforeEachProviders,
inject
} from '@angular/core/testing/testing_internal';
import {afterEach, beforeEach, beforeEachProviders, describe, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
var db: any;
class MyService {}
@@ -27,12 +18,14 @@ fdescribe('some component', () => {
// This test will run.
});
});
describe('another component',
() => { it('also has a test', () => { throw 'This test will not run.'; }); });
describe('another component', () => {
it('also has a test', () => { throw 'This test will not run.'; });
});
// #enddocregion
// #docregion xdescribe
xdescribe('some component', () => { it('has a test', () => {throw 'This test will not run.';}); });
xdescribe(
'some component', () => { it('has a test', () => { throw 'This test will not run.'; }); });
describe('another component', () => {
it('also has a test', () => {
// This test will run.
@@ -70,9 +63,10 @@ describe('some component', () => {
// #docregion beforeEachProviders
describe('some component', () => {
beforeEachProviders(() => [{provide: MyService, useClass: MyMockService}]);
it('uses MyService', inject([MyService], (service: MyMockService) => {
// service is an instance of MyMockService.
}));
it('uses MyService', inject(
[MyService], (service: MyMockService) => {
// service is an instance of MyMockService.
}));
});
// #enddocregion