diff --git a/gulpfile.js b/gulpfile.js index cbc0b04e22..0119bc3c8b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1569,7 +1569,6 @@ var firstTask = true; - gulp.on('task_start', (e) => { if (firstTask) { firstTask = false; diff --git a/modules/@angular/common/index.ts b/modules/@angular/common/index.ts index a63e66af67..2c2d16007e 100644 --- a/modules/@angular/common/index.ts +++ b/modules/@angular/common/index.ts @@ -3,4 +3,3 @@ export * from './src/directives'; export * from './src/forms'; export * from './src/common_directives'; export * from './src/location'; - diff --git a/modules/@angular/common/src/forms.ts b/modules/@angular/common/src/forms.ts index 9fa986387f..e2126eb4c4 100644 --- a/modules/@angular/common/src/forms.ts +++ b/modules/@angular/common/src/forms.ts @@ -7,7 +7,8 @@ * to read information * from the form DOM elements. * - * Forms providers are not included in default providers; you must import these providers explicitly. + * Forms providers are not included in default providers; you must import these providers + * explicitly. */ export {AbstractControl, Control, ControlGroup, ControlArray} from './forms/model'; diff --git a/modules/@angular/common/src/forms/directives/radio_control_value_accessor.ts b/modules/@angular/common/src/forms/directives/radio_control_value_accessor.ts index 1df2ded4b7..a91007bb73 100644 --- a/modules/@angular/common/src/forms/directives/radio_control_value_accessor.ts +++ b/modules/@angular/common/src/forms/directives/radio_control_value_accessor.ts @@ -12,10 +12,7 @@ import { } from '@angular/core'; import {isPresent} from '../../../src/facade/lang'; import {ListWrapper} from '../../../src/facade/collection'; -import { - NG_VALUE_ACCESSOR, - ControlValueAccessor -} from './control_value_accessor'; +import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor'; import {NgControl} from './ng_control'; export const RADIO_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ { diff --git a/modules/@angular/common/src/pipes/async_pipe.ts b/modules/@angular/common/src/pipes/async_pipe.ts index 1fff610ff6..f77e863e1e 100644 --- a/modules/@angular/common/src/pipes/async_pipe.ts +++ b/modules/@angular/common/src/pipes/async_pipe.ts @@ -1,10 +1,4 @@ -import { - Pipe, - Injectable, - ChangeDetectorRef, - OnDestroy, - WrappedValue -} from '@angular/core'; +import {Pipe, Injectable, ChangeDetectorRef, OnDestroy, WrappedValue} from '@angular/core'; import {isBlank, isPresent, isPromise} from '../../src/facade/lang'; import {ObservableWrapper, Observable, EventEmitter} from '../../src/facade/async'; diff --git a/modules/@angular/common/src/pipes/i18n_plural_pipe.ts b/modules/@angular/common/src/pipes/i18n_plural_pipe.ts index 69475c6591..d674e964f5 100644 --- a/modules/@angular/common/src/pipes/i18n_plural_pipe.ts +++ b/modules/@angular/common/src/pipes/i18n_plural_pipe.ts @@ -1,10 +1,5 @@ import {Injectable, PipeTransform, Pipe} from '@angular/core'; -import { - isStringMap, - StringWrapper, - isPresent, - RegExpWrapper -} from '../../src/facade/lang'; +import {isStringMap, StringWrapper, isPresent, RegExpWrapper} from '../../src/facade/lang'; import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception'; var interpolationExp: RegExp = RegExpWrapper.create('#'); diff --git a/modules/@angular/common/test/directives/ng_class_spec.ts b/modules/@angular/common/test/directives/ng_class_spec.ts index 0dfefbe0b7..467dbd8410 100644 --- a/modules/@angular/common/test/directives/ng_class_spec.ts +++ b/modules/@angular/common/test/directives/ng_class_spec.ts @@ -10,7 +10,7 @@ import { it, xit, } from '@angular/core/testing/testing_internal'; -import { ComponentFixture, TestComponentBuilder } from '@angular/compiler/testing'; +import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing'; import {AsyncTestCompleter} from '@angular/core/testing/testing_internal'; import {ListWrapper, StringMapWrapper, SetWrapper} from '../../src/facade/collection'; import {Component, provide} from '@angular/core'; diff --git a/modules/@angular/common/test/directives/ng_if_spec.ts b/modules/@angular/common/test/directives/ng_if_spec.ts index 3ceb8b1fba..0a561f126b 100644 --- a/modules/@angular/common/test/directives/ng_if_spec.ts +++ b/modules/@angular/common/test/directives/ng_if_spec.ts @@ -28,7 +28,8 @@ export function main() { .createAsync(TestComponent) .then((fixture) => { fixture.detectChanges(); - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) + expect( + getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) .toEqual(1); expect(fixture.debugElement.nativeElement).toHaveText('hello'); async.done(); @@ -44,7 +45,8 @@ export function main() { .createAsync(TestComponent) .then((fixture) => { fixture.detectChanges(); - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) + expect( + getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) .toEqual(1); expect(fixture.debugElement.nativeElement).toHaveText('hello2'); async.done(); @@ -60,19 +62,22 @@ export function main() { .then((fixture) => { fixture.debugElement.componentInstance.booleanCondition = false; fixture.detectChanges(); - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) + expect( + getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) .toEqual(0); expect(fixture.debugElement.nativeElement).toHaveText(''); fixture.debugElement.componentInstance.booleanCondition = true; fixture.detectChanges(); - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) + expect( + getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) .toEqual(1); expect(fixture.debugElement.nativeElement).toHaveText('hello'); fixture.debugElement.componentInstance.booleanCondition = false; fixture.detectChanges(); - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) + expect( + getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) .toEqual(0); expect(fixture.debugElement.nativeElement).toHaveText(''); @@ -90,31 +95,36 @@ export function main() { .then((fixture) => { fixture.debugElement.componentInstance.booleanCondition = false; fixture.detectChanges(); - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) + expect( + getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) .toEqual(0); expect(fixture.debugElement.nativeElement).toHaveText(''); fixture.debugElement.componentInstance.booleanCondition = true; fixture.detectChanges(); - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) + expect( + getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) .toEqual(1); expect(fixture.debugElement.nativeElement).toHaveText('hello'); fixture.debugElement.componentInstance.nestedBooleanCondition = false; fixture.detectChanges(); - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) + expect( + getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) .toEqual(0); expect(fixture.debugElement.nativeElement).toHaveText(''); fixture.debugElement.componentInstance.nestedBooleanCondition = true; fixture.detectChanges(); - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) + expect( + getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) .toEqual(1); expect(fixture.debugElement.nativeElement).toHaveText('hello'); fixture.debugElement.componentInstance.booleanCondition = false; fixture.detectChanges(); - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) + expect( + getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) .toEqual(0); expect(fixture.debugElement.nativeElement).toHaveText(''); @@ -135,21 +145,24 @@ export function main() { .createAsync(TestComponent) .then((fixture) => { fixture.detectChanges(); - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) + expect( + getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) .toEqual(3); expect(getDOM().getText(fixture.debugElement.nativeElement)) .toEqual('helloNumberhelloStringhelloFunction'); fixture.debugElement.componentInstance.numberCondition = 0; fixture.detectChanges(); - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) + expect( + getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) .toEqual(1); expect(fixture.debugElement.nativeElement).toHaveText('helloString'); fixture.debugElement.componentInstance.numberCondition = 1; fixture.debugElement.componentInstance.stringCondition = "bar"; fixture.detectChanges(); - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) + expect( + getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) .toEqual(1); expect(fixture.debugElement.nativeElement).toHaveText('helloNumber'); async.done(); @@ -166,13 +179,17 @@ export function main() { .createAsync(TestComponent) .then((fixture) => { fixture.detectChanges(); - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) + expect(getDOM() + .querySelectorAll(fixture.debugElement.nativeElement, 'copy-me') + .length) .toEqual(1); expect(fixture.debugElement.nativeElement).toHaveText('hello'); fixture.debugElement.componentInstance.numberCondition = 2; fixture.detectChanges(); - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) + expect(getDOM() + .querySelectorAll(fixture.debugElement.nativeElement, 'copy-me') + .length) .toEqual(1); expect(fixture.debugElement.nativeElement).toHaveText('hello'); @@ -188,14 +205,14 @@ export function main() { .createAsync(TestComponent) .then((fixture) => { fixture.detectChanges(); - getDOM().addClass(getDOM().querySelector(fixture.debugElement.nativeElement, 'copy-me'), - "foo"); + getDOM().addClass( + getDOM().querySelector(fixture.debugElement.nativeElement, 'copy-me'), "foo"); fixture.debugElement.componentInstance.numberCondition = 2; fixture.detectChanges(); - expect( - getDOM().hasClass(getDOM().querySelector(fixture.debugElement.nativeElement, 'copy-me'), - "foo")) + expect(getDOM().hasClass( + getDOM().querySelector(fixture.debugElement.nativeElement, 'copy-me'), + "foo")) .toBe(true); async.done(); @@ -212,7 +229,9 @@ export function main() { .createAsync(TestComponent) .then((fixture) => { expect(() => fixture.detectChanges()).toThrowError(); - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length) + expect(getDOM() + .querySelectorAll(fixture.debugElement.nativeElement, 'copy-me') + .length) .toEqual(0); expect(fixture.debugElement.nativeElement).toHaveText(''); async.done(); diff --git a/modules/@angular/common/test/directives/ng_style_spec.ts b/modules/@angular/common/test/directives/ng_style_spec.ts index b8518b2a41..7360cc9b4c 100644 --- a/modules/@angular/common/test/directives/ng_style_spec.ts +++ b/modules/@angular/common/test/directives/ng_style_spec.ts @@ -31,7 +31,8 @@ export function main() { .createAsync(TestComponent) .then((fixture) => { fixture.detectChanges(); - expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) + expect( + getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) .toEqual('40px'); async.done(); @@ -49,13 +50,15 @@ export function main() { fixture.debugElement.componentInstance.expr = {'max-width': '40px'}; fixture.detectChanges(); - expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) + expect( + getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) .toEqual('40px'); expr = fixture.debugElement.componentInstance.expr; expr['max-width'] = '30%'; fixture.detectChanges(); - expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) + expect( + getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) .toEqual('30%'); async.done(); @@ -71,12 +74,14 @@ export function main() { .then((fixture) => { fixture.debugElement.componentInstance.expr = {'max-width': '40px'}; fixture.detectChanges(); - expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) + expect( + getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) .toEqual('40px'); StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width'); fixture.detectChanges(); - expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) + expect( + getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) .toEqual(''); async.done(); @@ -92,16 +97,20 @@ export function main() { .then((fixture) => { fixture.debugElement.componentInstance.expr = {'max-width': '40px'}; fixture.detectChanges(); - expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) + expect( + getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) .toEqual('40px'); - expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size')) + expect( + getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size')) .toEqual('12px'); StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width'); fixture.detectChanges(); - expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) + expect( + getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) .toEqual(''); - expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size')) + expect( + getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size')) .toEqual('12px'); async.done(); @@ -117,17 +126,21 @@ export function main() { .then((fixture) => { fixture.debugElement.componentInstance.expr = {'max-width': '40px'}; fixture.detectChanges(); - expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) + expect( + getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) .toEqual('40px'); - expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size')) + expect( + getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size')) .toEqual('12px'); StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width'); - expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size')) + expect( + getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size')) .toEqual('12px'); fixture.detectChanges(); - expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) + expect( + getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width')) .toEqual(''); async.done(); diff --git a/modules/@angular/common/test/forms/integration_spec.ts b/modules/@angular/common/test/forms/integration_spec.ts index 878ed7a117..3fa0c4571d 100644 --- a/modules/@angular/common/test/forms/integration_spec.ts +++ b/modules/@angular/common/test/forms/integration_spec.ts @@ -10,11 +10,7 @@ import { iit, xit } from '@angular/core/testing/testing_internal'; -import { - fakeAsync, - tick, - flushMicrotasks -} from '@angular/core/testing'; +import {fakeAsync, tick, flushMicrotasks} from '@angular/core/testing'; import {AsyncTestCompleter} from '@angular/core/testing/testing_internal'; import {TestComponentBuilder} from '@angular/compiler/testing'; import {ComponentFixture} from '@angular/compiler/testing'; @@ -51,15 +47,17 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = - new ControlGroup({"login": new Control("loginValue")}); - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = + new ControlGroup({"login": new Control("loginValue")}); + fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")); - expect(input.nativeElement.value).toEqual("loginValue"); - async.done(); - }); + var input = fixture.debugElement.query(By.css("input")); + expect(input.nativeElement.value).toEqual("loginValue"); + async.done(); + }); })); it("should throw if a form isn't passed into ngFormModel", @@ -68,11 +66,13 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - expect(() => fixture.detectChanges()) - .toThrowError(new RegExp(`ngFormModel expects a form. Please pass one in.`)); - async.done(); - }); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + expect(() => fixture.detectChanges()) + .toThrowError(new RegExp(`ngFormModel expects a form. Please pass one in.`)); + async.done(); + }); })); it("should update the control group values on DOM change", @@ -83,17 +83,19 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = form; - fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = form; + fixture.detectChanges(); + var input = fixture.debugElement.query(By.css("input")); - input.nativeElement.value = "updatedValue"; - dispatchEvent(input.nativeElement, "input"); + input.nativeElement.value = "updatedValue"; + dispatchEvent(input.nativeElement, "input"); - expect(form.value).toEqual({"login": "updatedValue"}); - async.done(); - }); + expect(form.value).toEqual({"login": "updatedValue"}); + async.done(); + }); })); it("should ignore the change event for ", @@ -104,19 +106,21 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = form; - fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = form; + fixture.detectChanges(); + var input = fixture.debugElement.query(By.css("input")); - input.nativeElement.value = "updatedValue"; + input.nativeElement.value = "updatedValue"; - ObservableWrapper.subscribe(form.valueChanges, - (value) => { throw 'Should not happen'; }); - dispatchEvent(input.nativeElement, "change"); + ObservableWrapper.subscribe(form.valueChanges, + (value) => { throw 'Should not happen'; }); + dispatchEvent(input.nativeElement, "change"); - async.done(); - }); + async.done(); + }); })); it("should emit ngSubmit event on submit", @@ -147,19 +151,21 @@ export function main() { var t = `
`; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = control; - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = control; + fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")); - expect(input.nativeElement.value).toEqual("loginValue"); + var input = fixture.debugElement.query(By.css("input")); + expect(input.nativeElement.value).toEqual("loginValue"); - input.nativeElement.value = "updatedValue"; - dispatchEvent(input.nativeElement, "input"); + input.nativeElement.value = "updatedValue"; + dispatchEvent(input.nativeElement, "input"); - expect(control.value).toEqual("updatedValue"); - async.done(); - }); + expect(control.value).toEqual("updatedValue"); + async.done(); + }); })); it("should update DOM elements when rebinding the control group", @@ -168,19 +174,21 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = - new ControlGroup({"login": new Control("oldValue")}); - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = + new ControlGroup({"login": new Control("oldValue")}); + fixture.detectChanges(); - fixture.debugElement.componentInstance.form = - new ControlGroup({"login": new Control("newValue")}); - fixture.detectChanges(); + fixture.debugElement.componentInstance.form = + new ControlGroup({"login": new Control("newValue")}); + fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")); - expect(input.nativeElement.value).toEqual("newValue"); - async.done(); - }); + var input = fixture.debugElement.query(By.css("input")); + expect(input.nativeElement.value).toEqual("newValue"); + async.done(); + }); })); it("should update DOM elements when updating the value of a control", @@ -192,18 +200,20 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = form; - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = form; + fixture.detectChanges(); - login.updateValue("newValue"); + login.updateValue("newValue"); - fixture.detectChanges(); + fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")); - expect(input.nativeElement.value).toEqual("newValue"); - async.done(); - }); + var input = fixture.debugElement.query(By.css("input")); + expect(input.nativeElement.value).toEqual("newValue"); + async.done(); + }); })); it("should mark controls as touched after interacting with the DOM control", @@ -215,19 +225,21 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = form; - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = form; + fixture.detectChanges(); - var loginEl = fixture.debugElement.query(By.css("input")); - expect(login.touched).toBe(false); + var loginEl = fixture.debugElement.query(By.css("input")); + expect(login.touched).toBe(false); - dispatchEvent(loginEl.nativeElement, "blur"); + dispatchEvent(loginEl.nativeElement, "blur"); - expect(login.touched).toBe(true); + expect(login.touched).toBe(true); - async.done(); - }); + async.done(); + }); })); describe("different control types", () => { @@ -237,20 +249,22 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = - new ControlGroup({"text": new Control("old")}); - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = + new ControlGroup({"text": new Control("old")}); + fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")); - expect(input.nativeElement.value).toEqual("old"); + var input = fixture.debugElement.query(By.css("input")); + expect(input.nativeElement.value).toEqual("old"); - input.nativeElement.value = "new"; - dispatchEvent(input.nativeElement, "input"); + input.nativeElement.value = "new"; + dispatchEvent(input.nativeElement, "input"); - expect(fixture.debugElement.componentInstance.form.value).toEqual({"text": "new"}); - async.done(); - }); + expect(fixture.debugElement.componentInstance.form.value).toEqual({"text": "new"}); + async.done(); + }); })); it("should support without type", @@ -259,19 +273,21 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = - new ControlGroup({"text": new Control("old")}); - fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")); - expect(input.nativeElement.value).toEqual("old"); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = + new ControlGroup({"text": new Control("old")}); + fixture.detectChanges(); + var input = fixture.debugElement.query(By.css("input")); + expect(input.nativeElement.value).toEqual("old"); - input.nativeElement.value = "new"; - dispatchEvent(input.nativeElement, "input"); + input.nativeElement.value = "new"; + dispatchEvent(input.nativeElement, "input"); - expect(fixture.debugElement.componentInstance.form.value).toEqual({"text": "new"}); - async.done(); - }); + expect(fixture.debugElement.componentInstance.form.value).toEqual({"text": "new"}); + async.done(); + }); })); it("should support `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = - new ControlGroup({"text": new Control('old')}); - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = + new ControlGroup({"text": new Control('old')}); + fixture.detectChanges(); - var textarea = fixture.debugElement.query(By.css("textarea")); - expect(textarea.nativeElement.value).toEqual("old"); + var textarea = fixture.debugElement.query(By.css("textarea")); + expect(textarea.nativeElement.value).toEqual("old"); - textarea.nativeElement.value = "new"; - dispatchEvent(textarea.nativeElement, "input"); + textarea.nativeElement.value = "new"; + dispatchEvent(textarea.nativeElement, "input"); - expect(fixture.debugElement.componentInstance.form.value).toEqual({"text": 'new'}); - async.done(); - }); + expect(fixture.debugElement.componentInstance.form.value).toEqual({"text": 'new'}); + async.done(); + }); })); it("should support ", @@ -302,20 +320,23 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = - new ControlGroup({"checkbox": new Control(true)}); - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = + new ControlGroup({"checkbox": new Control(true)}); + fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")); - expect(input.nativeElement.checked).toBe(true); + var input = fixture.debugElement.query(By.css("input")); + expect(input.nativeElement.checked).toBe(true); - input.nativeElement.checked = false; - dispatchEvent(input.nativeElement, "change"); + input.nativeElement.checked = false; + dispatchEvent(input.nativeElement, "change"); - expect(fixture.debugElement.componentInstance.form.value).toEqual({"checkbox": false}); - async.done(); - }); + expect(fixture.debugElement.componentInstance.form.value) + .toEqual({"checkbox": false}); + async.done(); + }); })); it("should support ", @@ -324,20 +345,22 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = - new ControlGroup({"num": new Control(10)}); - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = + new ControlGroup({"num": new Control(10)}); + fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")); - expect(input.nativeElement.value).toEqual("10"); + var input = fixture.debugElement.query(By.css("input")); + expect(input.nativeElement.value).toEqual("10"); - input.nativeElement.value = "20"; - dispatchEvent(input.nativeElement, "input"); + input.nativeElement.value = "20"; + dispatchEvent(input.nativeElement, "input"); - expect(fixture.debugElement.componentInstance.form.value).toEqual({"num": 20}); - async.done(); - }); + expect(fixture.debugElement.componentInstance.form.value).toEqual({"num": 20}); + async.done(); + }); })); it("should support when value is cleared in the UI", @@ -346,25 +369,27 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = - new ControlGroup({"num": new Control(10)}); - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = + new ControlGroup({"num": new Control(10)}); + fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")); - input.nativeElement.value = ""; - dispatchEvent(input.nativeElement, "input"); + var input = fixture.debugElement.query(By.css("input")); + input.nativeElement.value = ""; + dispatchEvent(input.nativeElement, "input"); - expect(fixture.debugElement.componentInstance.form.valid).toBe(false); - expect(fixture.debugElement.componentInstance.form.value).toEqual({"num": null}); + expect(fixture.debugElement.componentInstance.form.valid).toBe(false); + expect(fixture.debugElement.componentInstance.form.value).toEqual({"num": null}); - input.nativeElement.value = "0"; - dispatchEvent(input.nativeElement, "input"); + input.nativeElement.value = "0"; + dispatchEvent(input.nativeElement, "input"); - expect(fixture.debugElement.componentInstance.form.valid).toBe(true); - expect(fixture.debugElement.componentInstance.form.value).toEqual({"num": 0}); - async.done(); - }); + expect(fixture.debugElement.componentInstance.form.valid).toBe(true); + expect(fixture.debugElement.componentInstance.form.value).toEqual({"num": 0}); + async.done(); + }); })); @@ -375,16 +400,18 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = form; - fixture.debugElement.componentInstance.data = null; - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = form; + fixture.debugElement.componentInstance.data = null; + fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")); - expect(input.nativeElement.value).toEqual(""); + var input = fixture.debugElement.query(By.css("input")); + expect(input.nativeElement.value).toEqual(""); - async.done(); - }); + async.done(); + }); })); it("should support ", @@ -394,24 +421,26 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = new ControlGroup({ - "foodChicken": new Control(new RadioButtonState(false, 'chicken')), - "foodFish": new Control(new RadioButtonState(true, 'fish')) - }); - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = new ControlGroup({ + "foodChicken": new Control(new RadioButtonState(false, 'chicken')), + "foodFish": new Control(new RadioButtonState(true, 'fish')) + }); + fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")); - expect(input.nativeElement.checked).toEqual(false); + var input = fixture.debugElement.query(By.css("input")); + expect(input.nativeElement.checked).toEqual(false); - dispatchEvent(input.nativeElement, "change"); - fixture.detectChanges(); + dispatchEvent(input.nativeElement, "change"); + fixture.detectChanges(); - let value = fixture.debugElement.componentInstance.form.value; - expect(value['foodChicken'].checked).toEqual(true); - expect(value['foodFish'].checked).toEqual(false); - async.done(); - }); + let value = fixture.debugElement.componentInstance.form.value; + expect(value['foodChicken'].checked).toEqual(true); + expect(value['foodFish'].checked).toEqual(false); + async.done(); + }); })); describe("should support `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.detectChanges(); - var select = fixture.debugElement.query(By.css("select")); - var sfOption = fixture.debugElement.query(By.css("option")); + var select = fixture.debugElement.query(By.css("select")); + var sfOption = fixture.debugElement.query(By.css("option")); - expect(select.nativeElement.value).toEqual("SF"); - expect(sfOption.nativeElement.selected).toBe(true); - async.done(); - }); + expect(select.nativeElement.value).toEqual("SF"); + expect(sfOption.nativeElement.selected).toBe(true); + async.done(); + }); })); it("with basic selection and value bindings", @@ -444,51 +475,56 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - var testComp = fixture.debugElement.componentInstance; - testComp.list = [{"id": "0", "name": "SF"}, {"id": "1", "name": "NYC"}]; - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + var testComp = fixture.debugElement.componentInstance; + testComp.list = [{"id": "0", "name": "SF"}, {"id": "1", "name": "NYC"}]; + fixture.detectChanges(); - var sfOption = fixture.debugElement.query(By.css("option")); - expect(sfOption.nativeElement.value).toEqual('0'); + var sfOption = fixture.debugElement.query(By.css("option")); + expect(sfOption.nativeElement.value).toEqual('0'); - testComp.list[0]['id'] = '2'; - fixture.detectChanges(); - expect(sfOption.nativeElement.value).toEqual('2'); - async.done(); - }); + testComp.list[0]['id'] = '2'; + fixture.detectChanges(); + expect(sfOption.nativeElement.value).toEqual('2'); + async.done(); + }); })); it("with ngControl", - inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, - async) => { - var t = `
+ inject([TestComponentBuilder, AsyncTestCompleter], + (tcb: TestComponentBuilder, async) => { + var t = `
`; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = - new ControlGroup({"city": new Control("SF")}); - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = + new ControlGroup({"city": new Control("SF")}); + fixture.detectChanges(); - var select = fixture.debugElement.query(By.css("select")); - var sfOption = fixture.debugElement.query(By.css("option")); + var select = fixture.debugElement.query(By.css("select")); + var sfOption = fixture.debugElement.query(By.css("option")); - expect(select.nativeElement.value).toEqual("SF"); - expect(sfOption.nativeElement.selected).toBe(true); + expect(select.nativeElement.value).toEqual("SF"); + expect(sfOption.nativeElement.selected).toBe(true); - select.nativeElement.value = "NYC"; - dispatchEvent(select.nativeElement, "change"); + select.nativeElement.value = "NYC"; + dispatchEvent(select.nativeElement, "change"); - expect(fixture.debugElement.componentInstance.form.value).toEqual({"city": 'NYC'}); - expect(sfOption.nativeElement.selected).toBe(false); - async.done(); - }); - })); + expect(fixture.debugElement.componentInstance.form.value) + .toEqual({"city": 'NYC'}); + expect(sfOption.nativeElement.selected).toBe(false); + async.done(); + }); + })); it("with a dynamic list of options", fakeAsync(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => { @@ -499,8 +535,9 @@ export function main() {
`; var fixture; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((compFixture) => fixture = - compFixture); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((compFixture) => fixture = compFixture); tick(); fixture.debugElement.componentInstance.form = @@ -523,27 +560,29 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { - var testComp = fixture.debugElement.componentInstance; - testComp.list = [{"name": "SF"}, {"name": "NYC"}, {"name": "Buffalo"}]; - testComp.selectedCity = testComp.list[1]; - fixture.detectChanges(); + var testComp = fixture.debugElement.componentInstance; + testComp.list = [{"name": "SF"}, {"name": "NYC"}, {"name": "Buffalo"}]; + testComp.selectedCity = testComp.list[1]; + fixture.detectChanges(); - var select = fixture.debugElement.query(By.css("select")); - var nycOption = fixture.debugElement.queryAll(By.css("option"))[1]; + var select = fixture.debugElement.query(By.css("select")); + var nycOption = fixture.debugElement.queryAll(By.css("option"))[1]; - expect(select.nativeElement.value).toEqual("1: Object"); - expect(nycOption.nativeElement.selected).toBe(true); + expect(select.nativeElement.value).toEqual("1: Object"); + expect(nycOption.nativeElement.selected).toBe(true); - select.nativeElement.value = "2: Object"; - dispatchEvent(select.nativeElement, "change"); - fixture.detectChanges(); - TimerWrapper.setTimeout(() => { - expect(testComp.selectedCity['name']).toEqual("Buffalo"); - async.done(); - }, 0); - }); + select.nativeElement.value = "2: Object"; + dispatchEvent(select.nativeElement, "change"); + fixture.detectChanges(); + TimerWrapper.setTimeout(() => { + expect(testComp.selectedCity['name']).toEqual("Buffalo"); + async.done(); + }, 0); + }); })); it("when new options are added", @@ -555,23 +594,25 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { - var testComp: MyComp8 = fixture.debugElement.componentInstance; - testComp.list = [{"name": "SF"}, {"name": "NYC"}]; - testComp.selectedCity = testComp.list[1]; - fixture.detectChanges(); + var testComp: MyComp8 = fixture.debugElement.componentInstance; + testComp.list = [{"name": "SF"}, {"name": "NYC"}]; + testComp.selectedCity = testComp.list[1]; + fixture.detectChanges(); - testComp.list.push({"name": "Buffalo"}); - testComp.selectedCity = testComp.list[2]; - fixture.detectChanges(); + testComp.list.push({"name": "Buffalo"}); + testComp.selectedCity = testComp.list[2]; + fixture.detectChanges(); - var select = fixture.debugElement.query(By.css("select")); - var buffalo = fixture.debugElement.queryAll(By.css("option"))[2]; - expect(select.nativeElement.value).toEqual("2: Object"); - expect(buffalo.nativeElement.selected).toBe(true); - async.done(); - }); + var select = fixture.debugElement.query(By.css("select")); + var buffalo = fixture.debugElement.queryAll(By.css("option"))[2]; + expect(select.nativeElement.value).toEqual("2: Object"); + expect(buffalo.nativeElement.selected).toBe(true); + async.done(); + }); })); it("when options are removed", @@ -582,22 +623,24 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { - var testComp: MyComp8 = fixture.debugElement.componentInstance; - testComp.list = [{"name": "SF"}, {"name": "NYC"}]; - testComp.selectedCity = testComp.list[1]; - fixture.detectChanges(); + var testComp: MyComp8 = fixture.debugElement.componentInstance; + testComp.list = [{"name": "SF"}, {"name": "NYC"}]; + testComp.selectedCity = testComp.list[1]; + fixture.detectChanges(); - var select = fixture.debugElement.query(By.css("select")); - expect(select.nativeElement.value).toEqual("1: Object"); + var select = fixture.debugElement.query(By.css("select")); + expect(select.nativeElement.value).toEqual("1: Object"); - testComp.list.pop(); - fixture.detectChanges(); + testComp.list.pop(); + fixture.detectChanges(); - expect(select.nativeElement.value).not.toEqual("1: Object"); - async.done(); - }); + expect(select.nativeElement.value).not.toEqual("1: Object"); + async.done(); + }); })); it("when option values change identity while tracking by index", @@ -609,25 +652,27 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { - var testComp = fixture.debugElement.componentInstance; + var testComp = fixture.debugElement.componentInstance; - testComp.list = [{"name": "SF"}, {"name": "NYC"}]; - testComp.selectedCity = testComp.list[0]; - fixture.detectChanges(); + testComp.list = [{"name": "SF"}, {"name": "NYC"}]; + testComp.selectedCity = testComp.list[0]; + fixture.detectChanges(); - testComp.list[1] = "Buffalo"; - testComp.selectedCity = testComp.list[1]; - fixture.detectChanges(); + testComp.list[1] = "Buffalo"; + testComp.selectedCity = testComp.list[1]; + fixture.detectChanges(); - var select = fixture.debugElement.query(By.css("select")); - var buffalo = fixture.debugElement.queryAll(By.css("option"))[1]; + var select = fixture.debugElement.query(By.css("select")); + var buffalo = fixture.debugElement.queryAll(By.css("option"))[1]; - expect(select.nativeElement.value).toEqual("1: Buffalo"); - expect(buffalo.nativeElement.selected).toBe(true); - async.done(); - }); + expect(select.nativeElement.value).toEqual("1: Buffalo"); + expect(buffalo.nativeElement.selected).toBe(true); + async.done(); + }); })); it("with duplicate option values", @@ -639,24 +684,26 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { - var testComp = fixture.debugElement.componentInstance; + var testComp = fixture.debugElement.componentInstance; - testComp.list = [{"name": "NYC"}, {"name": "SF"}, {"name": "SF"}]; - testComp.selectedCity = testComp.list[0]; - fixture.detectChanges(); + testComp.list = [{"name": "NYC"}, {"name": "SF"}, {"name": "SF"}]; + testComp.selectedCity = testComp.list[0]; + fixture.detectChanges(); - testComp.selectedCity = testComp.list[1]; - fixture.detectChanges(); + testComp.selectedCity = testComp.list[1]; + fixture.detectChanges(); - var select = fixture.debugElement.query(By.css("select")); - var firstSF = fixture.debugElement.queryAll(By.css("option"))[1]; + var select = fixture.debugElement.query(By.css("select")); + var firstSF = fixture.debugElement.queryAll(By.css("option"))[1]; - expect(select.nativeElement.value).toEqual("1: Object"); - expect(firstSF.nativeElement.selected).toBe(true); - async.done(); - }); + expect(select.nativeElement.value).toEqual("1: Object"); + expect(firstSF.nativeElement.selected).toBe(true); + async.done(); + }); })); it("when option values have same content, but different identities", @@ -668,23 +715,25 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { - var testComp = fixture.debugElement.componentInstance; - testComp.list = [{"name": "SF"}, {"name": "NYC"}, {"name": "NYC"}]; - testComp.selectedCity = testComp.list[0]; - fixture.detectChanges(); + var testComp = fixture.debugElement.componentInstance; + testComp.list = [{"name": "SF"}, {"name": "NYC"}, {"name": "NYC"}]; + testComp.selectedCity = testComp.list[0]; + fixture.detectChanges(); - testComp.selectedCity = testComp.list[2]; - fixture.detectChanges(); + testComp.selectedCity = testComp.list[2]; + fixture.detectChanges(); - var select = fixture.debugElement.query(By.css("select")); - var secondNYC = fixture.debugElement.queryAll(By.css("option"))[2]; + var select = fixture.debugElement.query(By.css("select")); + var secondNYC = fixture.debugElement.queryAll(By.css("option"))[2]; - expect(select.nativeElement.value).toEqual("2: Object"); - expect(secondNYC.nativeElement.selected).toBe(true); - async.done(); - }); + expect(select.nativeElement.value).toEqual("2: Object"); + expect(secondNYC.nativeElement.selected).toBe(true); + async.done(); + }); })); }); @@ -694,19 +743,21 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = - new ControlGroup({"name": new Control("aa")}); - fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")); - expect(input.nativeElement.value).toEqual("!aa!"); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = + new ControlGroup({"name": new Control("aa")}); + fixture.detectChanges(); + var input = fixture.debugElement.query(By.css("input")); + expect(input.nativeElement.value).toEqual("!aa!"); - input.nativeElement.value = "!bb!"; - dispatchEvent(input.nativeElement, "input"); + input.nativeElement.value = "!bb!"; + dispatchEvent(input.nativeElement, "input"); - expect(fixture.debugElement.componentInstance.form.value).toEqual({"name": "bb"}); - async.done(); - }); + expect(fixture.debugElement.componentInstance.form.value).toEqual({"name": "bb"}); + async.done(); + }); })); it("should support custom value accessors on non builtin input elements that fire a change event without a 'target' property", @@ -715,20 +766,23 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = - new ControlGroup({"name": new Control("aa")}); - fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("my-input")); - expect(input.componentInstance.value).toEqual("!aa!"); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = + new ControlGroup({"name": new Control("aa")}); + fixture.detectChanges(); + var input = fixture.debugElement.query(By.css("my-input")); + expect(input.componentInstance.value).toEqual("!aa!"); - input.componentInstance.value = "!bb!"; - ObservableWrapper.subscribe(input.componentInstance.onInput, (value) => { - expect(fixture.debugElement.componentInstance.form.value).toEqual({"name": "bb"}); - async.done(); - }); - input.componentInstance.dispatchChangeEvent(); - }); + input.componentInstance.value = "!bb!"; + ObservableWrapper.subscribe(input.componentInstance.onInput, (value) => { + expect(fixture.debugElement.componentInstance.form.value) + .toEqual({"name": "bb"}); + async.done(); + }); + input.componentInstance.dispatchChangeEvent(); + }); })); }); @@ -745,38 +799,40 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = form; - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = form; + fixture.detectChanges(); - var required = fixture.debugElement.query(By.css("[required]")); - var minLength = fixture.debugElement.query(By.css("[minlength]")); - var maxLength = fixture.debugElement.query(By.css("[maxlength]")); + var required = fixture.debugElement.query(By.css("[required]")); + var minLength = fixture.debugElement.query(By.css("[minlength]")); + var maxLength = fixture.debugElement.query(By.css("[maxlength]")); - required.nativeElement.value = ""; - minLength.nativeElement.value = "1"; - maxLength.nativeElement.value = "1234"; - dispatchEvent(required.nativeElement, "input"); - dispatchEvent(minLength.nativeElement, "input"); - dispatchEvent(maxLength.nativeElement, "input"); + required.nativeElement.value = ""; + minLength.nativeElement.value = "1"; + maxLength.nativeElement.value = "1234"; + dispatchEvent(required.nativeElement, "input"); + dispatchEvent(minLength.nativeElement, "input"); + dispatchEvent(maxLength.nativeElement, "input"); - expect(form.hasError("required", ["login"])).toEqual(true); - expect(form.hasError("minlength", ["min"])).toEqual(true); - expect(form.hasError("maxlength", ["max"])).toEqual(true); + expect(form.hasError("required", ["login"])).toEqual(true); + expect(form.hasError("minlength", ["min"])).toEqual(true); + expect(form.hasError("maxlength", ["max"])).toEqual(true); - expect(form.hasError("loginIsEmpty")).toEqual(true); + expect(form.hasError("loginIsEmpty")).toEqual(true); - required.nativeElement.value = "1"; - minLength.nativeElement.value = "123"; - maxLength.nativeElement.value = "123"; - dispatchEvent(required.nativeElement, "input"); - dispatchEvent(minLength.nativeElement, "input"); - dispatchEvent(maxLength.nativeElement, "input"); + required.nativeElement.value = "1"; + minLength.nativeElement.value = "123"; + maxLength.nativeElement.value = "123"; + dispatchEvent(required.nativeElement, "input"); + dispatchEvent(minLength.nativeElement, "input"); + dispatchEvent(maxLength.nativeElement, "input"); - expect(form.valid).toEqual(true); + expect(form.valid).toEqual(true); - async.done(); - }); + async.done(); + }); })); it("should use async validators defined in the html", @@ -816,19 +872,21 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = form; - fixture.detectChanges(); - expect(form.valid).toEqual(true); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = form; + fixture.detectChanges(); + expect(form.valid).toEqual(true); - var input = fixture.debugElement.query(By.css("input")); + var input = fixture.debugElement.query(By.css("input")); - input.nativeElement.value = ""; - dispatchEvent(input.nativeElement, "input"); + input.nativeElement.value = ""; + dispatchEvent(input.nativeElement, "input"); - expect(form.valid).toEqual(false); - async.done(); - }); + expect(form.valid).toEqual(false); + async.done(); + }); })); it("should use async validators defined in the model", @@ -878,14 +936,16 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = form; - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = form; + fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")); - expect(input.nativeElement.value).toEqual("value"); - async.done(); - }); + var input = fixture.debugElement.query(By.css("input")); + expect(input.nativeElement.value).toEqual("value"); + async.done(); + }); })); it("should update the control group values on DOM change", @@ -899,17 +959,19 @@ export function main() { `; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = form; - fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = form; + fixture.detectChanges(); + var input = fixture.debugElement.query(By.css("input")); - input.nativeElement.value = "updatedValue"; - dispatchEvent(input.nativeElement, "input"); + input.nativeElement.value = "updatedValue"; + dispatchEvent(input.nativeElement, "input"); - expect(form.value).toEqual({"nested": {"login": "updatedValue"}}); - async.done(); - }); + expect(form.value).toEqual({"nested": {"login": "updatedValue"}}); + async.done(); + }); })); }); @@ -1002,13 +1064,15 @@ export function main() { var t = `
`; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.name = null; - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.name = null; + fixture.detectChanges(); - expect(fixture.debugElement.children[0].providerTokens.length).toEqual(0); - async.done(); - }); + expect(fixture.debugElement.children[0].providerTokens.length).toEqual(0); + async.done(); + }); })); it("should remove controls", @@ -1151,25 +1215,29 @@ export function main() { var t = `
`; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = form; - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = form; + fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")).nativeElement; - expect(sortedClassList(input)).toEqual(['ng-invalid', 'ng-pristine', 'ng-untouched']); + var input = fixture.debugElement.query(By.css("input")).nativeElement; + expect(sortedClassList(input)) + .toEqual(['ng-invalid', 'ng-pristine', 'ng-untouched']); - dispatchEvent(input, "blur"); - fixture.detectChanges(); + dispatchEvent(input, "blur"); + fixture.detectChanges(); - expect(sortedClassList(input)).toEqual(["ng-invalid", "ng-pristine", "ng-touched"]); + expect(sortedClassList(input)) + .toEqual(["ng-invalid", "ng-pristine", "ng-touched"]); - input.value = "updatedValue"; - dispatchEvent(input, "input"); - fixture.detectChanges(); + input.value = "updatedValue"; + dispatchEvent(input, "input"); + fixture.detectChanges(); - expect(sortedClassList(input)).toEqual(["ng-dirty", "ng-touched", "ng-valid"]); - async.done(); - }); + expect(sortedClassList(input)).toEqual(["ng-dirty", "ng-touched", "ng-valid"]); + async.done(); + }); })); it("should work with complex model-driven forms", @@ -1178,50 +1246,58 @@ export function main() { var t = `
`; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.form = form; - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.form = form; + fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")).nativeElement; - expect(sortedClassList(input)).toEqual(["ng-invalid", "ng-pristine", "ng-untouched"]); + var input = fixture.debugElement.query(By.css("input")).nativeElement; + expect(sortedClassList(input)) + .toEqual(["ng-invalid", "ng-pristine", "ng-untouched"]); - dispatchEvent(input, "blur"); - fixture.detectChanges(); + dispatchEvent(input, "blur"); + fixture.detectChanges(); - expect(sortedClassList(input)).toEqual(["ng-invalid", "ng-pristine", "ng-touched"]); + expect(sortedClassList(input)) + .toEqual(["ng-invalid", "ng-pristine", "ng-touched"]); - input.value = "updatedValue"; - dispatchEvent(input, "input"); - fixture.detectChanges(); + input.value = "updatedValue"; + dispatchEvent(input, "input"); + fixture.detectChanges(); - expect(sortedClassList(input)).toEqual(["ng-dirty", "ng-touched", "ng-valid"]); - async.done(); - }); + expect(sortedClassList(input)).toEqual(["ng-dirty", "ng-touched", "ng-valid"]); + async.done(); + }); })); it("should work with ngModel", inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => { var t = `
`; - tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => { - fixture.debugElement.componentInstance.name = ""; - fixture.detectChanges(); + tcb.overrideTemplate(MyComp8, t) + .createAsync(MyComp8) + .then((fixture) => { + fixture.debugElement.componentInstance.name = ""; + fixture.detectChanges(); - var input = fixture.debugElement.query(By.css("input")).nativeElement; - expect(sortedClassList(input)).toEqual(["ng-invalid", "ng-pristine", "ng-untouched"]); + var input = fixture.debugElement.query(By.css("input")).nativeElement; + expect(sortedClassList(input)) + .toEqual(["ng-invalid", "ng-pristine", "ng-untouched"]); - dispatchEvent(input, "blur"); - fixture.detectChanges(); + dispatchEvent(input, "blur"); + fixture.detectChanges(); - expect(sortedClassList(input)).toEqual(["ng-invalid", "ng-pristine", "ng-touched"]); + expect(sortedClassList(input)) + .toEqual(["ng-invalid", "ng-pristine", "ng-touched"]); - input.value = "updatedValue"; - dispatchEvent(input, "input"); - fixture.detectChanges(); + input.value = "updatedValue"; + dispatchEvent(input, "input"); + fixture.detectChanges(); - expect(sortedClassList(input)).toEqual(["ng-dirty", "ng-touched", "ng-valid"]); - async.done(); - }); + expect(sortedClassList(input)).toEqual(["ng-dirty", "ng-touched", "ng-valid"]); + async.done(); + }); })); }); diff --git a/modules/@angular/common/test/forms/model_spec.ts b/modules/@angular/common/test/forms/model_spec.ts index 15840db6fa..251b1d4d7b 100644 --- a/modules/@angular/common/test/forms/model_spec.ts +++ b/modules/@angular/common/test/forms/model_spec.ts @@ -9,12 +9,7 @@ import { afterEach, inject, } from '@angular/core/testing/testing_internal'; -import { - fakeAsync, - flushMicrotasks, - Log, - tick -} from '@angular/core/testing'; +import {fakeAsync, flushMicrotasks, Log, tick} from '@angular/core/testing'; import {AsyncTestCompleter} from '@angular/core/testing/testing_internal'; import {ControlGroup, Control, ControlArray, Validators} from '@angular/common'; import {IS_DART, isPresent} from '../../src/facade/lang'; diff --git a/modules/@angular/common/test/forms/validators_spec.ts b/modules/@angular/common/test/forms/validators_spec.ts index ea52390620..0aa5c89b82 100644 --- a/modules/@angular/common/test/forms/validators_spec.ts +++ b/modules/@angular/common/test/forms/validators_spec.ts @@ -8,12 +8,7 @@ import { beforeEach, afterEach } from '@angular/core/testing/testing_internal'; -import { - fakeAsync, - flushMicrotasks, - Log, - tick -} from '@angular/core/testing'; +import {fakeAsync, flushMicrotasks, Log, tick} from '@angular/core/testing'; import {ControlGroup, Control, Validators, AbstractControl, ControlArray} from '@angular/common'; import {PromiseWrapper} from '../../src/facade/promise'; import {EventEmitter, ObservableWrapper, TimerWrapper} from '../../src/facade/async'; diff --git a/modules/@angular/common/test/spies.ts b/modules/@angular/common/test/spies.ts index dde165550a..bfd86a6610 100644 --- a/modules/@angular/common/test/spies.ts +++ b/modules/@angular/common/test/spies.ts @@ -10,6 +10,4 @@ export class SpyChangeDetectorRef extends SpyObject { export class SpyNgControl extends SpyObject {} -export class SpyValueAccessor extends SpyObject { - writeValue: any; -} +export class SpyValueAccessor extends SpyObject { writeValue: any; } diff --git a/modules/@angular/compiler/core_private.ts b/modules/@angular/compiler/core_private.ts index 6009eb2db7..cdb8a1e889 100644 --- a/modules/@angular/compiler/core_private.ts +++ b/modules/@angular/compiler/core_private.ts @@ -1,16 +1,19 @@ import {__core_private__ as r, __core_private_types__ as t} from '@angular/core'; -export var isDefaultChangeDetectionStrategy: typeof t.isDefaultChangeDetectionStrategy = r.isDefaultChangeDetectionStrategy; +export var isDefaultChangeDetectionStrategy: typeof t.isDefaultChangeDetectionStrategy = + r.isDefaultChangeDetectionStrategy; export type ChangeDetectorState = t.ChangeDetectorState; export var ChangeDetectorState: typeof t.ChangeDetectorState = r.ChangeDetectorState; -export var CHANGE_DETECTION_STRATEGY_VALUES: typeof t.CHANGE_DETECTION_STRATEGY_VALUES = r.CHANGE_DETECTION_STRATEGY_VALUES; +export var CHANGE_DETECTION_STRATEGY_VALUES: typeof t.CHANGE_DETECTION_STRATEGY_VALUES = + r.CHANGE_DETECTION_STRATEGY_VALUES; export var constructDependencies: typeof t.constructDependencies = r.constructDependencies; export type LifecycleHooks = t.LifecycleHooks; export var LifecycleHooks: typeof t.LifecycleHooks = r.LifecycleHooks; export var LIFECYCLE_HOOKS_VALUES: typeof t.LIFECYCLE_HOOKS_VALUES = r.LIFECYCLE_HOOKS_VALUES; export type ReflectorReader = t.ReflectorReader; export var ReflectorReader: typeof t.ReflectorReader = r.ReflectorReader; -export var ReflectorComponentResolver: typeof t.ReflectorComponentResolver = r.ReflectorComponentResolver; +export var ReflectorComponentResolver: typeof t.ReflectorComponentResolver = + r.ReflectorComponentResolver; export type AppElement = t.AppElement; export var AppElement: typeof t.AppElement = r.AppElement; export var AppView: typeof t.AppView = r.AppView; @@ -20,10 +23,12 @@ export type ViewType = t.ViewType; export var ViewType: typeof t.ViewType = r.ViewType; export var MAX_INTERPOLATION_VALUES: typeof t.MAX_INTERPOLATION_VALUES = r.MAX_INTERPOLATION_VALUES; export var checkBinding: typeof t.checkBinding = r.checkBinding; -export var flattenNestedViewRenderNodes: typeof t.flattenNestedViewRenderNodes = r.flattenNestedViewRenderNodes; +export var flattenNestedViewRenderNodes: typeof t.flattenNestedViewRenderNodes = + r.flattenNestedViewRenderNodes; export var interpolate: typeof t.interpolate = r.interpolate; export var ViewUtils: typeof t.ViewUtils = r.ViewUtils; -export var VIEW_ENCAPSULATION_VALUES: typeof t.VIEW_ENCAPSULATION_VALUES = r.VIEW_ENCAPSULATION_VALUES; +export var VIEW_ENCAPSULATION_VALUES: typeof t.VIEW_ENCAPSULATION_VALUES = + r.VIEW_ENCAPSULATION_VALUES; export var DebugContext: typeof t.DebugContext = r.DebugContext; export var StaticNodeDebugInfo: typeof t.StaticNodeDebugInfo = r.StaticNodeDebugInfo; export var devModeEqual: typeof t.devModeEqual = r.devModeEqual; @@ -49,4 +54,3 @@ export var pureProxy10: typeof t.pureProxy10 = r.pureProxy10; export var castByValue: typeof t.castByValue = r.castByValue; export type Console = t.Console; export var Console: typeof t.Console = r.Console; - diff --git a/modules/@angular/compiler/src/compile_metadata.ts b/modules/@angular/compiler/src/compile_metadata.ts index 2cf93b3d6b..af74c35647 100644 --- a/modules/@angular/compiler/src/compile_metadata.ts +++ b/modules/@angular/compiler/src/compile_metadata.ts @@ -316,7 +316,9 @@ export class CompileTokenMetadata implements CompileMetadataWithIdentifier { (isPresent(ak) && ak == token2.assetCacheKey); } - get name(): string { return isPresent(this.value) ? sanitizeIdentifier(this.value) : this.identifier.name; } + get name(): string { + return isPresent(this.value) ? sanitizeIdentifier(this.value) : this.identifier.name; + } } export class CompileTokenMap { diff --git a/modules/@angular/compiler/src/directive_resolver.ts b/modules/@angular/compiler/src/directive_resolver.ts index 712ba73942..cfcb2c1d49 100644 --- a/modules/@angular/compiler/src/directive_resolver.ts +++ b/modules/@angular/compiler/src/directive_resolver.ts @@ -12,7 +12,7 @@ import { ContentChildMetadata, ViewChildMetadata, reflector - } from '@angular/core'; +} from '@angular/core'; import {ReflectorReader} from '../core_private'; import {Type, isPresent, stringify} from '../src/facade/lang'; diff --git a/modules/@angular/compiler/src/html_lexer.ts b/modules/@angular/compiler/src/html_lexer.ts index e870bd6c2e..0e25d640f4 100644 --- a/modules/@angular/compiler/src/html_lexer.ts +++ b/modules/@angular/compiler/src/html_lexer.ts @@ -1,10 +1,4 @@ -import { - StringWrapper, - NumberWrapper, - isPresent, - isBlank, - serializeEnum -} from '../src/facade/lang'; +import {StringWrapper, NumberWrapper, isPresent, isBlank, serializeEnum} from '../src/facade/lang'; import {ListWrapper} from '../src/facade/collection'; import {ParseLocation, ParseError, ParseSourceFile, ParseSourceSpan} from './parse_util'; import {getHtmlTagDefinition, HtmlTagContentType, NAMED_ENTITIES} from './html_tags'; diff --git a/modules/@angular/compiler/src/identifiers.ts b/modules/@angular/compiler/src/identifiers.ts index 5af4222b3e..9254c0dd29 100644 --- a/modules/@angular/compiler/src/identifiers.ts +++ b/modules/@angular/compiler/src/identifiers.ts @@ -84,20 +84,14 @@ var impEMPTY_ARRAY = EMPTY_ARRAY; var impEMPTY_MAP = EMPTY_MAP; export class Identifiers { - static ViewUtils = new CompileIdentifierMetadata({ - name: 'ViewUtils', - moduleUrl: assetUrl('core', 'linker/view_utils'), - runtime: impViewUtils - }); + static ViewUtils = new CompileIdentifierMetadata( + {name: 'ViewUtils', moduleUrl: assetUrl('core', 'linker/view_utils'), runtime: impViewUtils}); static AppView = new CompileIdentifierMetadata( {name: 'AppView', moduleUrl: APP_VIEW_MODULE_URL, runtime: impAppView}); static DebugAppView = new CompileIdentifierMetadata( {name: 'DebugAppView', moduleUrl: APP_VIEW_MODULE_URL, runtime: impDebugAppView}); - static AppElement = new CompileIdentifierMetadata({ - name: 'AppElement', - moduleUrl: assetUrl('core', 'linker/element'), - runtime: impAppElement - }); + static AppElement = new CompileIdentifierMetadata( + {name: 'AppElement', moduleUrl: assetUrl('core', 'linker/element'), runtime: impAppElement}); static ElementRef = new CompileIdentifierMetadata({ name: 'ElementRef', moduleUrl: assetUrl('core', 'linker/element_ref'), @@ -118,11 +112,8 @@ export class Identifiers { moduleUrl: assetUrl('core', 'render/api'), runtime: impRenderComponentType }); - static QueryList = new CompileIdentifierMetadata({ - name: 'QueryList', - moduleUrl: assetUrl('core', 'linker/query_list'), - runtime: impQueryList - }); + static QueryList = new CompileIdentifierMetadata( + {name: 'QueryList', moduleUrl: assetUrl('core', 'linker/query_list'), runtime: impQueryList}); static TemplateRef = new CompileIdentifierMetadata({ name: 'TemplateRef', moduleUrl: assetUrl('core', 'linker/template_ref'), @@ -135,21 +126,15 @@ export class Identifiers { }); static ValueUnwrapper = new CompileIdentifierMetadata( {name: 'ValueUnwrapper', moduleUrl: CD_MODULE_URL, runtime: impValueUnwrapper}); - static Injector = new CompileIdentifierMetadata({ - name: 'Injector', - moduleUrl: assetUrl('core', 'di/injector'), - runtime: impInjector - }); + static Injector = new CompileIdentifierMetadata( + {name: 'Injector', moduleUrl: assetUrl('core', 'di/injector'), runtime: impInjector}); static ViewEncapsulation = new CompileIdentifierMetadata({ name: 'ViewEncapsulation', moduleUrl: assetUrl('core', 'metadata/view'), runtime: impViewEncapsulation }); - static ViewType = new CompileIdentifierMetadata({ - name: 'ViewType', - moduleUrl: assetUrl('core', 'linker/view_type'), - runtime: impViewType - }); + static ViewType = new CompileIdentifierMetadata( + {name: 'ViewType', moduleUrl: assetUrl('core', 'linker/view_type'), runtime: impViewType}); static ChangeDetectionStrategy = new CompileIdentifierMetadata({ name: 'ChangeDetectionStrategy', moduleUrl: CD_MODULE_URL, @@ -165,11 +150,8 @@ export class Identifiers { moduleUrl: assetUrl('core', 'linker/debug_context'), runtime: impDebugContext }); - static Renderer = new CompileIdentifierMetadata({ - name: 'Renderer', - moduleUrl: assetUrl('core', 'render/api'), - runtime: impRenderer - }); + static Renderer = new CompileIdentifierMetadata( + {name: 'Renderer', moduleUrl: assetUrl('core', 'render/api'), runtime: impRenderer}); static SimpleChange = new CompileIdentifierMetadata( {name: 'SimpleChange', moduleUrl: CD_MODULE_URL, runtime: impSimpleChange}); static uninitialized = new CompileIdentifierMetadata( diff --git a/modules/@angular/compiler/src/legacy_template.ts b/modules/@angular/compiler/src/legacy_template.ts index 1288616586..fe157e277d 100644 --- a/modules/@angular/compiler/src/legacy_template.ts +++ b/modules/@angular/compiler/src/legacy_template.ts @@ -1,11 +1,6 @@ import {Injectable, Provider, provide} from '@angular/core'; -import { - StringWrapper, - RegExpWrapper, - isBlank, - isPresent -} from '../src/facade/lang'; +import {StringWrapper, RegExpWrapper, isBlank, isPresent} from '../src/facade/lang'; import { HtmlAstVisitor, diff --git a/modules/@angular/compiler/src/metadata_resolver.ts b/modules/@angular/compiler/src/metadata_resolver.ts index 85083c6766..392e7ca8de 100644 --- a/modules/@angular/compiler/src/metadata_resolver.ts +++ b/modules/@angular/compiler/src/metadata_resolver.ts @@ -7,9 +7,12 @@ import { HostMetadata, SkipSelfMetadata, Provider, - PLATFORM_DIRECTIVES, PLATFORM_PIPES, + PLATFORM_DIRECTIVES, + PLATFORM_PIPES, reflector, - Injectable, Inject, Optional, + Injectable, + Inject, + Optional, ViewMetadata, NoAnnotationError, QueryMetadata, @@ -17,10 +20,7 @@ import { InjectMetadata, ViewQueryMetadata } from '@angular/core'; -import { - constructDependencies, - LIFECYCLE_HOOKS_VALUES, ReflectorReader -} from '../core_private'; +import {constructDependencies, LIFECYCLE_HOOKS_VALUES, ReflectorReader} from '../core_private'; import { Type, isBlank, @@ -413,7 +413,7 @@ function calcTemplateBaseUrl(reflector: ReflectorReader, type: any, var moduleId = cmpMetadata.moduleId; var scheme = getUrlScheme(moduleId); return isPresent(scheme) && scheme.length > 0 ? moduleId : - `package:${moduleId}${MODULE_SUFFIX}`; + `package:${moduleId}${MODULE_SUFFIX}`; } return reflector.importUri(type); diff --git a/modules/@angular/compiler/src/offline_compiler.ts b/modules/@angular/compiler/src/offline_compiler.ts index 0abfbad57c..ad8e742105 100644 --- a/modules/@angular/compiler/src/offline_compiler.ts +++ b/modules/@angular/compiler/src/offline_compiler.ts @@ -17,7 +17,8 @@ import {OutputEmitter} from './output/abstract_emitter'; import * as o from './output/output_ast'; import { - MODULE_SUFFIX, assetUrl, + MODULE_SUFFIX, + assetUrl, } from './util'; var _COMPONENT_FACTORY_IDENTIFIER = new CompileIdentifierMetadata({ diff --git a/modules/@angular/compiler/src/output/abstract_emitter.ts b/modules/@angular/compiler/src/output/abstract_emitter.ts index 3e72ca2b8b..56453cddbe 100644 --- a/modules/@angular/compiler/src/output/abstract_emitter.ts +++ b/modules/@angular/compiler/src/output/abstract_emitter.ts @@ -1,9 +1,4 @@ -import { - isPresent, - isBlank, - isString, - StringWrapper -} from '../../src/facade/lang'; +import {isPresent, isBlank, isString, StringWrapper} from '../../src/facade/lang'; import {BaseException} from '../../src/facade/exceptions'; import * as o from './output_ast'; diff --git a/modules/@angular/compiler/src/output/dart_emitter.ts b/modules/@angular/compiler/src/output/dart_emitter.ts index 304b511e0a..f85dd5039a 100644 --- a/modules/@angular/compiler/src/output/dart_emitter.ts +++ b/modules/@angular/compiler/src/output/dart_emitter.ts @@ -1,8 +1,4 @@ -import { - isPresent, - isBlank, - isArray -} from '../../src/facade/lang'; +import {isPresent, isBlank, isArray} from '../../src/facade/lang'; import {BaseException} from '../../src/facade/exceptions'; import {CompileIdentifierMetadata} from '../compile_metadata'; import * as o from './output_ast'; diff --git a/modules/@angular/compiler/src/output/output_interpreter.ts b/modules/@angular/compiler/src/output/output_interpreter.ts index 408ca51235..5d8f826edc 100644 --- a/modules/@angular/compiler/src/output/output_interpreter.ts +++ b/modules/@angular/compiler/src/output/output_interpreter.ts @@ -1,9 +1,5 @@ import {reflector} from '@angular/core'; -import { - isPresent, - IS_DART, - FunctionWrapper -} from '../../src/facade/lang'; +import {isPresent, IS_DART, FunctionWrapper} from '../../src/facade/lang'; import {ObservableWrapper} from '../../src/facade/async'; import {BaseException, unimplemented} from '../../src/facade/exceptions'; import {ListWrapper} from '../../src/facade/collection'; diff --git a/modules/@angular/compiler/src/output/ts_emitter.ts b/modules/@angular/compiler/src/output/ts_emitter.ts index 5521f0ed7e..74256d5d89 100644 --- a/modules/@angular/compiler/src/output/ts_emitter.ts +++ b/modules/@angular/compiler/src/output/ts_emitter.ts @@ -1,9 +1,5 @@ import * as o from './output_ast'; -import { - isPresent, - isBlank, - isArray -} from '../../src/facade/lang'; +import {isPresent, isBlank, isArray} from '../../src/facade/lang'; import {BaseException} from '../../src/facade/exceptions'; import {CompileIdentifierMetadata} from '../compile_metadata'; import { diff --git a/modules/@angular/compiler/src/pipe_resolver.ts b/modules/@angular/compiler/src/pipe_resolver.ts index 905be3a058..5d47ceed01 100644 --- a/modules/@angular/compiler/src/pipe_resolver.ts +++ b/modules/@angular/compiler/src/pipe_resolver.ts @@ -1,8 +1,6 @@ import {resolveForwardRef, Injectable, PipeMetadata, reflector} from '@angular/core'; -import { - ReflectorReader -} from '../core_private'; +import {ReflectorReader} from '../core_private'; import {Type, isPresent, stringify} from '../src/facade/lang'; import {BaseException} from '../src/facade/exceptions'; diff --git a/modules/@angular/compiler/src/provider_parser.ts b/modules/@angular/compiler/src/provider_parser.ts index cb3844234f..06b4bdafb8 100644 --- a/modules/@angular/compiler/src/provider_parser.ts +++ b/modules/@angular/compiler/src/provider_parser.ts @@ -5,7 +5,8 @@ import { AttrAst, DirectiveAst, ProviderAst, - ProviderAstType, ReferenceAst + ProviderAstType, + ReferenceAst } from './template_ast'; import { CompileTypeMetadata, diff --git a/modules/@angular/compiler/src/schema/dom_element_schema_registry.ts b/modules/@angular/compiler/src/schema/dom_element_schema_registry.ts index 870d9b8509..dcf9d0ff8a 100644 --- a/modules/@angular/compiler/src/schema/dom_element_schema_registry.ts +++ b/modules/@angular/compiler/src/schema/dom_element_schema_registry.ts @@ -50,153 +50,153 @@ const OBJECT = 'object'; * NOTE: This schema is auto extracted from `schema_extractor.ts` located in the test folder. */ const SCHEMA: string[] = - /*@ts2dart_const*/ ([ - '*|%classList,className,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*copy,*cut,*paste,*search,*selectstart,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerHTML,#scrollLeft,#scrollTop', - '^*|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*autocomplete,*autocompleteerror,*beforecopy,*beforecut,*beforepaste,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*message,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*paste,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*search,*seeked,*seeking,*select,*selectstart,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate', - 'media|!autoplay,!controls,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,#playbackRate,preload,src,#volume', - '@svg:^*|*abort,*autocomplete,*autocompleteerror,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,%style,#tabIndex', - '@svg:graphics^@svg:|', - '@svg:animation^@svg:|*begin,*end,*repeat', - '@svg:geometry^@svg:|', - '@svg:componentTransferFunction^@svg:|', - '@svg:gradient^@svg:|', - '@svg:textContent^@svg:graphics|', - '@svg:textPositioning^@svg:textContent|', - 'a|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,rel,rev,search,shape,target,text,type,username', - 'area|alt,coords,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,search,shape,target,username', - 'audio^media|', - 'br|clear', - 'base|href,target', - 'body|aLink,background,bgColor,link,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink', - 'button|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value', - 'canvas|#height,#width', - 'content|select', - 'dl|!compact', - 'datalist|', - 'details|!open', - 'dialog|!open,returnValue', - 'dir|!compact', - 'div|align', - 'embed|align,height,name,src,type,width', - 'fieldset|!disabled,name', - 'font|color,face,size', - 'form|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target', - 'frame|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src', - 'frameset|cols,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows', - 'hr|align,color,!noShade,size,width', - 'head|', - 'h1,h2,h3,h4,h5,h6|align', - 'html|version', - 'iframe|align,!allowFullscreen,frameBorder,height,longDesc,marginHeight,marginWidth,name,%sandbox,scrolling,src,srcdoc,width', - 'img|align,alt,border,%crossOrigin,#height,#hspace,!isMap,longDesc,lowsrc,name,sizes,src,srcset,useMap,#vspace,#width', - 'input|accept,align,alt,autocapitalize,autocomplete,!autofocus,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width', - 'keygen|!autofocus,challenge,!disabled,keytype,name', - 'li|type,#value', - 'label|htmlFor', - 'legend|align', - 'link|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,rel,%relList,rev,%sizes,target,type', - 'map|name', - 'marquee|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width', - 'menu|!compact', - 'meta|content,httpEquiv,name,scheme', - 'meter|#high,#low,#max,#min,#optimum,#value', - 'ins,del|cite,dateTime', - 'ol|!compact,!reversed,#start,type', - 'object|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width', - 'optgroup|!disabled,label', - 'option|!defaultSelected,!disabled,label,!selected,text,value', - 'output|defaultValue,%htmlFor,name,value', - 'p|align', - 'param|name,type,value,valueType', - 'picture|', - 'pre|#width', - 'progress|#max,#value', - 'q,blockquote,cite|', - 'script|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type', - 'select|!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value', - 'shadow|', - 'source|media,sizes,src,srcset,type', - 'span|', - 'style|!disabled,media,type', - 'caption|align', - 'th,td|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width', - 'col,colgroup|align,ch,chOff,#span,vAlign,width', - 'table|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width', - 'tr|align,bgColor,ch,chOff,vAlign', - 'tfoot,thead,tbody|align,ch,chOff,vAlign', - 'template|', - 'textarea|autocapitalize,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap', - 'title|text', - 'track|!default,kind,label,src,srclang', - 'ul|!compact,type', - 'unknown|', - 'video^media|#height,poster,#width', - '@svg:a^@svg:graphics|', - '@svg:animate^@svg:animation|', - '@svg:animateMotion^@svg:animation|', - '@svg:animateTransform^@svg:animation|', - '@svg:circle^@svg:geometry|', - '@svg:clipPath^@svg:graphics|', - '@svg:cursor^@svg:|', - '@svg:defs^@svg:graphics|', - '@svg:desc^@svg:|', - '@svg:discard^@svg:|', - '@svg:ellipse^@svg:geometry|', - '@svg:feBlend^@svg:|', - '@svg:feColorMatrix^@svg:|', - '@svg:feComponentTransfer^@svg:|', - '@svg:feComposite^@svg:|', - '@svg:feConvolveMatrix^@svg:|', - '@svg:feDiffuseLighting^@svg:|', - '@svg:feDisplacementMap^@svg:|', - '@svg:feDistantLight^@svg:|', - '@svg:feDropShadow^@svg:|', - '@svg:feFlood^@svg:|', - '@svg:feFuncA^@svg:componentTransferFunction|', - '@svg:feFuncB^@svg:componentTransferFunction|', - '@svg:feFuncG^@svg:componentTransferFunction|', - '@svg:feFuncR^@svg:componentTransferFunction|', - '@svg:feGaussianBlur^@svg:|', - '@svg:feImage^@svg:|', - '@svg:feMerge^@svg:|', - '@svg:feMergeNode^@svg:|', - '@svg:feMorphology^@svg:|', - '@svg:feOffset^@svg:|', - '@svg:fePointLight^@svg:|', - '@svg:feSpecularLighting^@svg:|', - '@svg:feSpotLight^@svg:|', - '@svg:feTile^@svg:|', - '@svg:feTurbulence^@svg:|', - '@svg:filter^@svg:|', - '@svg:foreignObject^@svg:graphics|', - '@svg:g^@svg:graphics|', - '@svg:image^@svg:graphics|', - '@svg:line^@svg:geometry|', - '@svg:linearGradient^@svg:gradient|', - '@svg:mpath^@svg:|', - '@svg:marker^@svg:|', - '@svg:mask^@svg:|', - '@svg:metadata^@svg:|', - '@svg:path^@svg:geometry|', - '@svg:pattern^@svg:|', - '@svg:polygon^@svg:geometry|', - '@svg:polyline^@svg:geometry|', - '@svg:radialGradient^@svg:gradient|', - '@svg:rect^@svg:geometry|', - '@svg:svg^@svg:graphics|#currentScale,#zoomAndPan', - '@svg:script^@svg:|type', - '@svg:set^@svg:animation|', - '@svg:stop^@svg:|', - '@svg:style^@svg:|!disabled,media,title,type', - '@svg:switch^@svg:graphics|', - '@svg:symbol^@svg:|', - '@svg:tspan^@svg:textPositioning|', - '@svg:text^@svg:textPositioning|', - '@svg:textPath^@svg:textContent|', - '@svg:title^@svg:|', - '@svg:use^@svg:graphics|', - '@svg:view^@svg:|#zoomAndPan' - ]); + /*@ts2dart_const*/ ([ + '*|%classList,className,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*copy,*cut,*paste,*search,*selectstart,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerHTML,#scrollLeft,#scrollTop', + '^*|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*autocomplete,*autocompleteerror,*beforecopy,*beforecut,*beforepaste,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*message,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*paste,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*search,*seeked,*seeking,*select,*selectstart,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate', + 'media|!autoplay,!controls,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,#playbackRate,preload,src,#volume', + '@svg:^*|*abort,*autocomplete,*autocompleteerror,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,%style,#tabIndex', + '@svg:graphics^@svg:|', + '@svg:animation^@svg:|*begin,*end,*repeat', + '@svg:geometry^@svg:|', + '@svg:componentTransferFunction^@svg:|', + '@svg:gradient^@svg:|', + '@svg:textContent^@svg:graphics|', + '@svg:textPositioning^@svg:textContent|', + 'a|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,rel,rev,search,shape,target,text,type,username', + 'area|alt,coords,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,search,shape,target,username', + 'audio^media|', + 'br|clear', + 'base|href,target', + 'body|aLink,background,bgColor,link,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink', + 'button|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value', + 'canvas|#height,#width', + 'content|select', + 'dl|!compact', + 'datalist|', + 'details|!open', + 'dialog|!open,returnValue', + 'dir|!compact', + 'div|align', + 'embed|align,height,name,src,type,width', + 'fieldset|!disabled,name', + 'font|color,face,size', + 'form|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target', + 'frame|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src', + 'frameset|cols,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows', + 'hr|align,color,!noShade,size,width', + 'head|', + 'h1,h2,h3,h4,h5,h6|align', + 'html|version', + 'iframe|align,!allowFullscreen,frameBorder,height,longDesc,marginHeight,marginWidth,name,%sandbox,scrolling,src,srcdoc,width', + 'img|align,alt,border,%crossOrigin,#height,#hspace,!isMap,longDesc,lowsrc,name,sizes,src,srcset,useMap,#vspace,#width', + 'input|accept,align,alt,autocapitalize,autocomplete,!autofocus,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width', + 'keygen|!autofocus,challenge,!disabled,keytype,name', + 'li|type,#value', + 'label|htmlFor', + 'legend|align', + 'link|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,rel,%relList,rev,%sizes,target,type', + 'map|name', + 'marquee|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width', + 'menu|!compact', + 'meta|content,httpEquiv,name,scheme', + 'meter|#high,#low,#max,#min,#optimum,#value', + 'ins,del|cite,dateTime', + 'ol|!compact,!reversed,#start,type', + 'object|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width', + 'optgroup|!disabled,label', + 'option|!defaultSelected,!disabled,label,!selected,text,value', + 'output|defaultValue,%htmlFor,name,value', + 'p|align', + 'param|name,type,value,valueType', + 'picture|', + 'pre|#width', + 'progress|#max,#value', + 'q,blockquote,cite|', + 'script|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type', + 'select|!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value', + 'shadow|', + 'source|media,sizes,src,srcset,type', + 'span|', + 'style|!disabled,media,type', + 'caption|align', + 'th,td|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width', + 'col,colgroup|align,ch,chOff,#span,vAlign,width', + 'table|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width', + 'tr|align,bgColor,ch,chOff,vAlign', + 'tfoot,thead,tbody|align,ch,chOff,vAlign', + 'template|', + 'textarea|autocapitalize,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap', + 'title|text', + 'track|!default,kind,label,src,srclang', + 'ul|!compact,type', + 'unknown|', + 'video^media|#height,poster,#width', + '@svg:a^@svg:graphics|', + '@svg:animate^@svg:animation|', + '@svg:animateMotion^@svg:animation|', + '@svg:animateTransform^@svg:animation|', + '@svg:circle^@svg:geometry|', + '@svg:clipPath^@svg:graphics|', + '@svg:cursor^@svg:|', + '@svg:defs^@svg:graphics|', + '@svg:desc^@svg:|', + '@svg:discard^@svg:|', + '@svg:ellipse^@svg:geometry|', + '@svg:feBlend^@svg:|', + '@svg:feColorMatrix^@svg:|', + '@svg:feComponentTransfer^@svg:|', + '@svg:feComposite^@svg:|', + '@svg:feConvolveMatrix^@svg:|', + '@svg:feDiffuseLighting^@svg:|', + '@svg:feDisplacementMap^@svg:|', + '@svg:feDistantLight^@svg:|', + '@svg:feDropShadow^@svg:|', + '@svg:feFlood^@svg:|', + '@svg:feFuncA^@svg:componentTransferFunction|', + '@svg:feFuncB^@svg:componentTransferFunction|', + '@svg:feFuncG^@svg:componentTransferFunction|', + '@svg:feFuncR^@svg:componentTransferFunction|', + '@svg:feGaussianBlur^@svg:|', + '@svg:feImage^@svg:|', + '@svg:feMerge^@svg:|', + '@svg:feMergeNode^@svg:|', + '@svg:feMorphology^@svg:|', + '@svg:feOffset^@svg:|', + '@svg:fePointLight^@svg:|', + '@svg:feSpecularLighting^@svg:|', + '@svg:feSpotLight^@svg:|', + '@svg:feTile^@svg:|', + '@svg:feTurbulence^@svg:|', + '@svg:filter^@svg:|', + '@svg:foreignObject^@svg:graphics|', + '@svg:g^@svg:graphics|', + '@svg:image^@svg:graphics|', + '@svg:line^@svg:geometry|', + '@svg:linearGradient^@svg:gradient|', + '@svg:mpath^@svg:|', + '@svg:marker^@svg:|', + '@svg:mask^@svg:|', + '@svg:metadata^@svg:|', + '@svg:path^@svg:geometry|', + '@svg:pattern^@svg:|', + '@svg:polygon^@svg:geometry|', + '@svg:polyline^@svg:geometry|', + '@svg:radialGradient^@svg:gradient|', + '@svg:rect^@svg:geometry|', + '@svg:svg^@svg:graphics|#currentScale,#zoomAndPan', + '@svg:script^@svg:|type', + '@svg:set^@svg:animation|', + '@svg:stop^@svg:|', + '@svg:style^@svg:|!disabled,media,title,type', + '@svg:switch^@svg:graphics|', + '@svg:symbol^@svg:|', + '@svg:tspan^@svg:textPositioning|', + '@svg:text^@svg:textPositioning|', + '@svg:textPath^@svg:textContent|', + '@svg:title^@svg:|', + '@svg:use^@svg:graphics|', + '@svg:view^@svg:|#zoomAndPan' + ]); var attrToPropMap: {[name: string]: string} = { 'class': 'className', diff --git a/modules/@angular/compiler/src/schema/element_schema_registry.ts b/modules/@angular/compiler/src/schema/element_schema_registry.ts index 2e0d8c9317..bfbd5db161 100644 --- a/modules/@angular/compiler/src/schema/element_schema_registry.ts +++ b/modules/@angular/compiler/src/schema/element_schema_registry.ts @@ -2,4 +2,3 @@ export class ElementSchemaRegistry { hasProperty(tagName: string, propName: string): boolean { return true; } getMappedPropName(propName: string): string { return propName; } } - diff --git a/modules/@angular/compiler/src/style_compiler.ts b/modules/@angular/compiler/src/style_compiler.ts index 4c9cae2ae7..0211c79793 100644 --- a/modules/@angular/compiler/src/style_compiler.ts +++ b/modules/@angular/compiler/src/style_compiler.ts @@ -1,8 +1,5 @@ import {ViewEncapsulation, Injectable} from '@angular/core'; -import { - CompileIdentifierMetadata, - CompileDirectiveMetadata -} from './compile_metadata'; +import {CompileIdentifierMetadata, CompileDirectiveMetadata} from './compile_metadata'; import * as o from './output/output_ast'; import {ShadowCss} from './shadow_css'; import {UrlResolver} from './url_resolver'; diff --git a/modules/@angular/compiler/src/util.ts b/modules/@angular/compiler/src/util.ts index 067498f6cc..d53ba6d07f 100644 --- a/modules/@angular/compiler/src/util.ts +++ b/modules/@angular/compiler/src/util.ts @@ -70,7 +70,7 @@ export class ValueTransformer implements ValueVisitor { visitOther(value: any, context: any): any { return value; } } -export function assetUrl(pkg: string, path: string = null, type:string = 'src'): string { +export function assetUrl(pkg: string, path: string = null, type: string = 'src'): string { if (IS_DART) { if (path == null) { return `asset:angular2/${pkg}/${pkg}.dart`; diff --git a/modules/@angular/compiler/src/view_compiler/compile_query.ts b/modules/@angular/compiler/src/view_compiler/compile_query.ts index a2c4a0b6c2..fca08f4d28 100644 --- a/modules/@angular/compiler/src/view_compiler/compile_query.ts +++ b/modules/@angular/compiler/src/view_compiler/compile_query.ts @@ -4,10 +4,7 @@ import {ListWrapper} from '../../src/facade/collection'; import * as o from '../output/output_ast'; import {Identifiers} from '../identifiers'; -import { - CompileQueryMetadata, - CompileTokenMap -} from '../compile_metadata'; +import {CompileQueryMetadata, CompileTokenMap} from '../compile_metadata'; import {CompileView} from './compile_view'; import {CompileElement} from './compile_element'; diff --git a/modules/@angular/compiler/src/view_compiler/compile_view.ts b/modules/@angular/compiler/src/view_compiler/compile_view.ts index 617702c5f5..c6197aaac8 100644 --- a/modules/@angular/compiler/src/view_compiler/compile_view.ts +++ b/modules/@angular/compiler/src/view_compiler/compile_view.ts @@ -20,7 +20,8 @@ import { getViewFactoryName, injectFromViewParentInjector, createDiTokenExpression, - getPropertyInView, createPureProxy + getPropertyInView, + createPureProxy } from './util'; import {CompilerConfig} from '../config'; import {CompileBinding} from './compile_binding'; diff --git a/modules/@angular/compiler/src/view_resolver.ts b/modules/@angular/compiler/src/view_resolver.ts index 9df4184b7e..f6e49d3105 100644 --- a/modules/@angular/compiler/src/view_resolver.ts +++ b/modules/@angular/compiler/src/view_resolver.ts @@ -5,9 +5,7 @@ import { reflector, } from '@angular/core'; -import { - ReflectorReader -} from '../core_private'; +import {ReflectorReader} from '../core_private'; import {Type, stringify, isBlank, isPresent} from '../src/facade/lang'; import {BaseException} from '../src/facade/exceptions'; diff --git a/modules/@angular/compiler/test/offline_compiler_codegen_typed.ts b/modules/@angular/compiler/test/offline_compiler_codegen_typed.ts index 6157d45b94..15b2682388 100644 --- a/modules/@angular/compiler/test/offline_compiler_codegen_typed.ts +++ b/modules/@angular/compiler/test/offline_compiler_codegen_typed.ts @@ -17,7 +17,7 @@ export function emit(): Promise { // Generator export function main(args: string[]) { emit().then((source) => { - // debug: console.error(source); - print(source); - }); + // debug: console.error(source); + print(source); + }); } diff --git a/modules/@angular/compiler/test/offline_compiler_codegen_untyped.ts b/modules/@angular/compiler/test/offline_compiler_codegen_untyped.ts index da6e757db1..8ffe3eeb09 100644 --- a/modules/@angular/compiler/test/offline_compiler_codegen_untyped.ts +++ b/modules/@angular/compiler/test/offline_compiler_codegen_untyped.ts @@ -15,7 +15,7 @@ export function emit() { // Generator export function main(args: string[]) { emit().then((source) => { - // debug: console.error(source); - print(source); - }); + // debug: console.error(source); + print(source); + }); } diff --git a/modules/@angular/compiler/test/output/output_emitter_codegen_typed.ts b/modules/@angular/compiler/test/output/output_emitter_codegen_typed.ts index 0e3b126a32..4e1b9e5291 100644 --- a/modules/@angular/compiler/test/output/output_emitter_codegen_typed.ts +++ b/modules/@angular/compiler/test/output/output_emitter_codegen_typed.ts @@ -15,8 +15,8 @@ export function getExpressions(): any { export function emit() { var emitter = IS_DART ? new DartEmitter() : new TypeScriptEmitter(); var emittedCode = - emitter.emitStatements(assetUrl('compiler', 'output/output_emitter_codegen_typed', 'test'), - codegenStmts, codegenExportsVars); + emitter.emitStatements(assetUrl('compiler', 'output/output_emitter_codegen_typed', 'test'), + codegenStmts, codegenExportsVars); return emittedCode; } diff --git a/modules/@angular/compiler/test/output/output_emitter_codegen_untyped.ts b/modules/@angular/compiler/test/output/output_emitter_codegen_untyped.ts index ffd39684b5..5792e84c6f 100644 --- a/modules/@angular/compiler/test/output/output_emitter_codegen_untyped.ts +++ b/modules/@angular/compiler/test/output/output_emitter_codegen_untyped.ts @@ -10,12 +10,11 @@ export function getExpressions(): any { } // Generator -export function emit () { +export function emit() { var emitter = new JavaScriptEmitter(); var emittedCode = - emitter.emitStatements( - assetUrl('compiler', 'output/output_emitter_codegen_untyped', 'test'), - codegenStmts, codegenExportsVars); + emitter.emitStatements(assetUrl('compiler', 'output/output_emitter_codegen_untyped', 'test'), + codegenStmts, codegenExportsVars); return emittedCode; } diff --git a/modules/@angular/compiler/test/output/output_emitter_spec.ts b/modules/@angular/compiler/test/output/output_emitter_spec.ts index 13e2132687..81d044f829 100644 --- a/modules/@angular/compiler/test/output/output_emitter_spec.ts +++ b/modules/@angular/compiler/test/output/output_emitter_spec.ts @@ -20,9 +20,12 @@ import {EventEmitter} from '@angular/core'; import {ViewType} from '@angular/core/src/linker/view_type'; import {BaseException} from '@angular/core'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; -import {browserDetection} from '@angular/platform-browser/testing' +import { + browserDetection +} from '@angular/platform-browser/testing' -export function main() { + export function + main() { var outputDefs = []; outputDefs.push({ 'getExpressions': () => interpretStatements(codegenStmts, 'getExpressions', diff --git a/modules/@angular/compiler/test/output/output_emitter_util.ts b/modules/@angular/compiler/test/output/output_emitter_util.ts index 2dd564d7b7..6cbe0f5f90 100644 --- a/modules/@angular/compiler/test/output/output_emitter_util.ts +++ b/modules/@angular/compiler/test/output/output_emitter_util.ts @@ -19,11 +19,8 @@ var testDataIdentifier = new CompileIdentifierMetadata({ runtime: ExternalClass }); -var eventEmitterIdentifier = new CompileIdentifierMetadata({ - name: 'EventEmitter', - moduleUrl: assetUrl('core'), - runtime: EventEmitter -}); +var eventEmitterIdentifier = new CompileIdentifierMetadata( + {name: 'EventEmitter', moduleUrl: assetUrl('core'), runtime: EventEmitter}); var enumIdentifier = new CompileIdentifierMetadata({ name: 'ViewType.HOST', @@ -31,11 +28,8 @@ var enumIdentifier = new CompileIdentifierMetadata({ runtime: ViewType.HOST }); -var baseExceptionIdentifier = new CompileIdentifierMetadata({ - name: 'BaseException', - moduleUrl: assetUrl('core'), - runtime: BaseException -}); +var baseExceptionIdentifier = new CompileIdentifierMetadata( + {name: 'BaseException', moduleUrl: assetUrl('core'), runtime: BaseException}); export var codegenExportsVars = [ 'getExpressions', diff --git a/modules/@angular/compiler/test/test_component_builder_spec.ts b/modules/@angular/compiler/test/test_component_builder_spec.ts index dac8f4c31b..0c9db5ae26 100644 --- a/modules/@angular/compiler/test/test_component_builder_spec.ts +++ b/modules/@angular/compiler/test/test_component_builder_spec.ts @@ -16,17 +16,27 @@ import { ComponentFixtureNoNgZone } from '@angular/compiler/testing'; import {AsyncTestCompleter} from '@angular/core/testing/testing_internal'; -import {Injectable, provide, Component, Input, ViewMetadata, ComponentResolver} from '@angular/core'; +import { + Injectable, + provide, + Component, + Input, + ViewMetadata, + ComponentResolver +} from '@angular/core'; import {NgIf} from '@angular/common'; import {IS_DART} from '../src/facade/lang'; import {PromiseWrapper} from '../src/facade/promise'; import {dispatchEvent} from "@angular/platform-browser/testing"; -import {withProviders} from "@angular/core/testing/test_injector" +import { + withProviders +} from "@angular/core/testing/test_injector" -@Component( - {selector: 'child-comp', template: `Original {{childBinding}}`, directives: []}) -@Injectable() -class ChildComp { + @Component({ + selector: 'child-comp', + template: `Original {{childBinding}}`, + directives: [] + }) @Injectable() class ChildComp { childBinding: string; constructor() { this.childBinding = 'Child'; } } diff --git a/modules/@angular/core/src/application_ref.ts b/modules/@angular/core/src/application_ref.ts index ba7626540c..c23ed73f21 100644 --- a/modules/@angular/core/src/application_ref.ts +++ b/modules/@angular/core/src/application_ref.ts @@ -1,12 +1,5 @@ import {NgZone, NgZoneError} from './zone/ng_zone'; -import { - Type, - isBlank, - isPresent, - assertionsEnabled, - lockMode, - isPromise -} from '../src/facade/lang'; +import {Type, isBlank, isPresent, assertionsEnabled, lockMode, isPromise} from '../src/facade/lang'; import {Injector, Injectable} from './di'; import {PLATFORM_INITIALIZER, APP_INITIALIZER} from './application_tokens'; import {PromiseWrapper, ObservableWrapper} from '../src/facade/async'; @@ -14,11 +7,7 @@ import {ListWrapper} from '../src/facade/collection'; import {TestabilityRegistry, Testability} from './testability/testability'; import {ComponentResolver} from './linker/component_resolver'; import {ComponentRef, ComponentFactory} from './linker/component_factory'; -import { - BaseException, - ExceptionHandler, - unimplemented -} from '../src/facade/exceptions'; +import {BaseException, ExceptionHandler, unimplemented} from '../src/facade/exceptions'; import {Console} from './console'; import {wtfLeave, wtfCreateScope, WtfScopeFn} from './profile/profile'; import {ChangeDetectorRef} from './change_detection/change_detector_ref'; diff --git a/modules/@angular/core/src/change_detection/change_detection_util.ts b/modules/@angular/core/src/change_detection/change_detection_util.ts index 7a0dca8a98..888b678886 100644 --- a/modules/@angular/core/src/change_detection/change_detection_util.ts +++ b/modules/@angular/core/src/change_detection/change_detection_util.ts @@ -1,8 +1,5 @@ import {looseIdentical, isPrimitive} from '../../src/facade/lang'; -import { - isListLikeIterable, - areIterablesEqual -} from '../../src/facade/collection'; +import {isListLikeIterable, areIterablesEqual} from '../../src/facade/collection'; export {looseIdentical} from '../../src/facade/lang'; export var uninitialized: Object = /*@ts2dart_const*/ new Object(); diff --git a/modules/@angular/core/src/debug/debug_renderer.ts b/modules/@angular/core/src/debug/debug_renderer.ts index 5c35d8bd09..ff2115aa81 100644 --- a/modules/@angular/core/src/debug/debug_renderer.ts +++ b/modules/@angular/core/src/debug/debug_renderer.ts @@ -1,10 +1,5 @@ import {isPresent} from '../../src/facade/lang'; -import { - Renderer, - RootRenderer, - RenderComponentType, - RenderDebugInfo -} from '../render/api'; +import {Renderer, RootRenderer, RenderComponentType, RenderDebugInfo} from '../render/api'; import { DebugNode, DebugElement, diff --git a/modules/@angular/core/src/di/provider.ts b/modules/@angular/core/src/di/provider.ts index 4db663bf16..9b69b704ee 100644 --- a/modules/@angular/core/src/di/provider.ts +++ b/modules/@angular/core/src/di/provider.ts @@ -1,11 +1,4 @@ -import { - normalizeBool, - Type, - isType, - isBlank, - isFunction, - stringify -} from '../../src/facade/lang'; +import {normalizeBool, Type, isType, isBlank, isFunction, stringify} from '../../src/facade/lang'; import {BaseException} from '../../src/facade/exceptions'; /** diff --git a/modules/@angular/core/src/linker/view_utils.ts b/modules/@angular/core/src/linker/view_utils.ts index 2c41724980..b11ce3eb97 100644 --- a/modules/@angular/core/src/linker/view_utils.ts +++ b/modules/@angular/core/src/linker/view_utils.ts @@ -1,8 +1,4 @@ -import { - isBlank, - isPresent, - looseIdentical -} from '../../src/facade/lang'; +import {isBlank, isPresent, looseIdentical} from '../../src/facade/lang'; import {ListWrapper, StringMapWrapper} from '../../src/facade/collection'; import {BaseException} from '../../src/facade/exceptions'; import {AppElement} from './element'; diff --git a/modules/@angular/core/src/reflection/reflection_capabilities.ts b/modules/@angular/core/src/reflection/reflection_capabilities.ts index 5ebe68a1c2..7d02242db3 100644 --- a/modules/@angular/core/src/reflection/reflection_capabilities.ts +++ b/modules/@angular/core/src/reflection/reflection_capabilities.ts @@ -1,11 +1,4 @@ -import { - Type, - isPresent, - isFunction, - global, - stringify, - ConcreteType -} from '../../src/facade/lang'; +import {Type, isPresent, isFunction, global, stringify, ConcreteType} from '../../src/facade/lang'; import {BaseException} from '../../src/facade/exceptions'; import {GetterFn, SetterFn, MethodFn} from './types'; import {PlatformReflectionCapabilities} from './platform_reflection_capabilities'; diff --git a/modules/@angular/core/test/debug/debug_node_spec.ts b/modules/@angular/core/test/debug/debug_node_spec.ts index 0e636aa9ca..46477600d2 100644 --- a/modules/@angular/core/test/debug/debug_node_spec.ts +++ b/modules/@angular/core/test/debug/debug_node_spec.ts @@ -294,7 +294,8 @@ export function main() { var childTestEls = fixture.debugElement.queryAll(By.css('child-comp')); expect(childTestEls.length).toBe(1); - expect(getDOM().hasClass(childTestEls[0].nativeElement, 'child-comp-class')).toBe(true); + expect(getDOM().hasClass(childTestEls[0].nativeElement, 'child-comp-class')) + .toBe(true); async.done(); }); diff --git a/modules/@angular/core/test/dev_mode_spec.ts b/modules/@angular/core/test/dev_mode_spec.ts index 2527514202..2ea58af325 100644 --- a/modules/@angular/core/test/dev_mode_spec.ts +++ b/modules/@angular/core/test/dev_mode_spec.ts @@ -1,14 +1,4 @@ -import { - beforeEach, - ddescribe, - describe, - expect, - iit, - inject, - it, - xdescribe, - xit -} from '../testing'; +import {beforeEach, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '../testing'; import {assertionsEnabled, IS_DART} from '../../router/src/facade/lang'; diff --git a/modules/@angular/core/test/directive_lifecycle_integration_spec.ts b/modules/@angular/core/test/directive_lifecycle_integration_spec.ts index 3256260dd1..8ba50e3704 100644 --- a/modules/@angular/core/test/directive_lifecycle_integration_spec.ts +++ b/modules/@angular/core/test/directive_lifecycle_integration_spec.ts @@ -9,7 +9,7 @@ import { xdescribe, xit, } from '@angular/core/testing/testing_internal'; -import { Log } from '@angular/core/testing'; +import {Log} from '@angular/core/testing'; import {AsyncTestCompleter} from '@angular/core/testing/testing_internal'; import {TestComponentBuilder} from '@angular/compiler/testing'; diff --git a/modules/@angular/core/test/dom/shim_spec.ts b/modules/@angular/core/test/dom/shim_spec.ts index 870aef9f0e..a9951bb991 100644 --- a/modules/@angular/core/test/dom/shim_spec.ts +++ b/modules/@angular/core/test/dom/shim_spec.ts @@ -23,4 +23,6 @@ export function main() { }); } -function identity(a) { return a; } +function identity(a) { + return a; +} diff --git a/modules/@angular/core/test/linker/integration_spec.ts b/modules/@angular/core/test/linker/integration_spec.ts index 9b82e96779..8f4d57902a 100644 --- a/modules/@angular/core/test/linker/integration_spec.ts +++ b/modules/@angular/core/test/linker/integration_spec.ts @@ -10,12 +10,7 @@ import { it, xit, } from '@angular/core/testing/testing_internal'; -import { - containsRegexp, - fakeAsync, - tick, - clearPendingTimers -} from '@angular/core/testing'; +import {containsRegexp, fakeAsync, tick, clearPendingTimers} from '@angular/core/testing'; import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing'; import {AsyncTestCompleter} from '@angular/core/testing/testing_internal'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; @@ -163,14 +158,14 @@ function declareTests(isJit: boolean) { .then((fixture) => { fixture.debugElement.componentInstance.ctxProp = 'Initial aria label'; fixture.detectChanges(); - expect( - getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, 'aria-label')) + expect(getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, + 'aria-label')) .toEqual('Initial aria label'); fixture.debugElement.componentInstance.ctxProp = 'Changed aria label'; fixture.detectChanges(); - expect( - getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, 'aria-label')) + expect(getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, + 'aria-label')) .toEqual('Changed aria label'); async.done(); @@ -187,12 +182,14 @@ function declareTests(isJit: boolean) { fixture.debugElement.componentInstance.ctxProp = 'bar'; fixture.detectChanges(); - expect(getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, 'foo')) + expect( + getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, 'foo')) .toEqual('bar'); fixture.debugElement.componentInstance.ctxProp = null; fixture.detectChanges(); - expect(getDOM().hasAttribute(fixture.debugElement.children[0].nativeElement, 'foo')) + expect( + getDOM().hasAttribute(fixture.debugElement.children[0].nativeElement, 'foo')) .toBeFalsy(); async.done(); @@ -1087,7 +1084,8 @@ function declareTests(isJit: boolean) { .then((fixture) => { fixture.detectChanges(); - expect(getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, "role")) + expect( + getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, "role")) .toEqual("button"); async.done(); @@ -1136,9 +1134,9 @@ function declareTests(isJit: boolean) { var dispatchedEvent = getDOM().createMouseEvent('click'); var dispatchedEvent2 = getDOM().createMouseEvent('click'); getDOM().dispatchEvent(fixture.debugElement.children[0].nativeElement, - dispatchedEvent); + dispatchedEvent); getDOM().dispatchEvent(fixture.debugElement.children[1].nativeElement, - dispatchedEvent2); + dispatchedEvent2); expect(getDOM().isPrevented(dispatchedEvent)).toBe(true); expect(getDOM().isPrevented(dispatchedEvent2)).toBe(false); expect(getDOM().getChecked(fixture.debugElement.children[0].nativeElement)) @@ -1379,7 +1377,8 @@ function declareTests(isJit: boolean) { })) .createAsync(MyComp) .then((fixture) => { - expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'script').length) + expect( + getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'script').length) .toEqual(0); async.done(); }); @@ -2531,7 +2530,8 @@ class DuplicateDir { @Directive({selector: '[no-duplicate]'}) class OtherDuplicateDir { constructor(elRef: ElementRef) { - getDOM().setText(elRef.nativeElement, getDOM().getText(elRef.nativeElement) + 'othernoduplicate'); + getDOM().setText(elRef.nativeElement, + getDOM().getText(elRef.nativeElement) + 'othernoduplicate'); } } diff --git a/modules/@angular/core/test/linker/query_integration_spec.ts b/modules/@angular/core/test/linker/query_integration_spec.ts index f9e83a4fa1..fc9a528394 100644 --- a/modules/@angular/core/test/linker/query_integration_spec.ts +++ b/modules/@angular/core/test/linker/query_integration_spec.ts @@ -269,18 +269,18 @@ export function main() { inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => { var template = ''; tcb.overrideTemplate(MyComp0, template) - .createAsync(MyComp0) - .then((view) => { - view.detectChanges(); - var needsTpl: NeedsTpl = view.debugElement.children[0].inject(NeedsTpl); + .createAsync(MyComp0) + .then((view) => { + view.detectChanges(); + var needsTpl: NeedsTpl = view.debugElement.children[0].inject(NeedsTpl); - expect(needsTpl.vc.createEmbeddedView(needsTpl.query.first).rootNodes[0]) - .toHaveText('light'); - expect(needsTpl.vc.createEmbeddedView(needsTpl.viewQuery.first).rootNodes[0]) - .toHaveText('shadow'); + expect(needsTpl.vc.createEmbeddedView(needsTpl.query.first).rootNodes[0]) + .toHaveText('light'); + expect(needsTpl.vc.createEmbeddedView(needsTpl.viewQuery.first).rootNodes[0]) + .toHaveText('shadow'); - async.done(); - }); + async.done(); + }); })); it('should find named TemplateRefs', @@ -866,7 +866,9 @@ class NeedsViewChild implements AfterViewInit, ngAfterViewInit() { this.logs.push(["init", isPresent(this.child) ? this.child.text : null]); } - ngAfterViewChecked() { this.logs.push(["check", isPresent(this.child) ? this.child.text : null]); } + ngAfterViewChecked() { + this.logs.push(["check", isPresent(this.child) ? this.child.text : null]); + } } @Directive({selector: '[dir]'}) diff --git a/modules/@angular/core/test/linker/view_injector_integration_spec.ts b/modules/@angular/core/test/linker/view_injector_integration_spec.ts index 1fa9c51b97..6b0e280f72 100644 --- a/modules/@angular/core/test/linker/view_injector_integration_spec.ts +++ b/modules/@angular/core/test/linker/view_injector_integration_spec.ts @@ -10,13 +10,7 @@ import { beforeEachProviders, inject, } from '@angular/core/testing/testing_internal'; -import { - fakeAsync, - flushMicrotasks, - Log, - tick, - containsRegexp -} from '@angular/core/testing'; +import {fakeAsync, flushMicrotasks, Log, tick, containsRegexp} from '@angular/core/testing'; import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing'; import {isBlank} from '../../src/facade/lang'; import { diff --git a/modules/@angular/core/test/reflection/reflector_spec.ts b/modules/@angular/core/test/reflection/reflector_spec.ts index ce4654cd63..0516b67601 100644 --- a/modules/@angular/core/test/reflection/reflector_spec.ts +++ b/modules/@angular/core/test/reflection/reflector_spec.ts @@ -19,9 +19,11 @@ import { HasGetterAndSetterDecorators } from './reflector_common'; import {IS_DART} from '../../src/facade/lang'; -import {browserDetection} from '@angular/platform-browser/testing' +import { + browserDetection +} from '@angular/platform-browser/testing' -class AType { + class AType { value; constructor(value) { this.value = value; } diff --git a/modules/@angular/core/test/testing_internal_spec.ts b/modules/@angular/core/test/testing_internal_spec.ts index 9e3814d5da..3819925d81 100644 --- a/modules/@angular/core/test/testing_internal_spec.ts +++ b/modules/@angular/core/test/testing_internal_spec.ts @@ -1,13 +1,4 @@ -import { - describe, - it, - iit, - ddescribe, - expect, - tick, - beforeEach, - containsRegexp -} from '../testing'; +import {describe, it, iit, ddescribe, expect, tick, beforeEach, containsRegexp} from '../testing'; import {SpyObject} from '@angular/core/testing/testing_internal'; import {MapWrapper} from '../../platform-browser/src/facade/collection'; diff --git a/modules/@angular/core/test/zone/ng_zone_spec.ts b/modules/@angular/core/test/zone/ng_zone_spec.ts index 64c689961a..12199a4908 100644 --- a/modules/@angular/core/test/zone/ng_zone_spec.ts +++ b/modules/@angular/core/test/zone/ng_zone_spec.ts @@ -9,9 +9,7 @@ import { xdescribe, xit, } from '@angular/core/testing/testing_internal'; -import { - Log -} from '@angular/core/testing'; +import {Log} from '@angular/core/testing'; import { PromiseCompleter, diff --git a/modules/@angular/core/testing/mock_application_ref.ts b/modules/@angular/core/testing/mock_application_ref.ts index f3ccd5cf28..72e4046eec 100644 --- a/modules/@angular/core/testing/mock_application_ref.ts +++ b/modules/@angular/core/testing/mock_application_ref.ts @@ -5,7 +5,7 @@ import { ComponentFactory, Injector, NgZone, - Type + Type } from '../index'; /** diff --git a/modules/@angular/core/testing/regexp.ts b/modules/@angular/core/testing/regexp.ts index 8c2ba75c1c..d1965fd49f 100644 --- a/modules/@angular/core/testing/regexp.ts +++ b/modules/@angular/core/testing/regexp.ts @@ -1,10 +1,9 @@ import {RegExpWrapper, StringWrapper} from '../src/facade/lang'; var _RE_SPECIAL_CHARS = - ['-', '[', ']', '/', '{', '}', '\\', '(', ')', '*', '+', '?', '.', '^', '$', '|']; + ['-', '[', ']', '/', '{', '}', '\\', '(', ')', '*', '+', '?', '.', '^', '$', '|']; var _ESCAPE_RE = RegExpWrapper.create(`[\\${_RE_SPECIAL_CHARS.join('\\')}]`); export function containsRegexp(input: string): RegExp { return RegExpWrapper.create( - StringWrapper.replaceAllMapped(input, _ESCAPE_RE, (match) => `\\${match[0]}`)); + StringWrapper.replaceAllMapped(input, _ESCAPE_RE, (match) => `\\${match[0]}`)); } - diff --git a/modules/@angular/core/testing/testing.ts b/modules/@angular/core/testing/testing.ts index e5f7e58aff..c01693d550 100644 --- a/modules/@angular/core/testing/testing.ts +++ b/modules/@angular/core/testing/testing.ts @@ -2,13 +2,7 @@ * Public Test Library for unit testing Angular2 Applications. Uses the * Jasmine framework. */ -import { - inject, - async, - injectAsync, - TestInjector, - getTestInjector -} from './test_injector'; +import {inject, async, injectAsync, TestInjector, getTestInjector} from './test_injector'; import {isPromise} from '../src/facade/lang'; diff --git a/modules/@angular/examples/core/ts/platform/platform.ts b/modules/@angular/examples/core/ts/platform/platform.ts index 7766945c43..ef27952387 100644 --- a/modules/@angular/examples/core/ts/platform/platform.ts +++ b/modules/@angular/examples/core/ts/platform/platform.ts @@ -9,7 +9,7 @@ class MyApp { } var platform = createPlatform(ReflectiveInjector.resolveAndCreate(BROWSER_PROVIDERS)); -var appInjector = - ReflectiveInjector.resolveAndCreate([BROWSER_APP_STATIC_PROVIDERS, appProviders], platform.injector); +var appInjector = ReflectiveInjector.resolveAndCreate([BROWSER_APP_STATIC_PROVIDERS, appProviders], + platform.injector); coreLoadAndBootstrap(appInjector, MyApp); // #enddocregion diff --git a/modules/@angular/facade/src/collection.ts b/modules/@angular/facade/src/collection.ts index de01d574e0..e0256f66f6 100644 --- a/modules/@angular/facade/src/collection.ts +++ b/modules/@angular/facade/src/collection.ts @@ -1,11 +1,4 @@ -import { - isJsObject, - global, - isPresent, - isBlank, - isArray, - getSymbolIterator -} from './lang'; +import {isJsObject, global, isPresent, isBlank, isArray, getSymbolIterator} from './lang'; export var Map = global.Map; export var Set = global.Set; diff --git a/modules/@angular/facade/test/async_spec.ts b/modules/@angular/facade/test/async_spec.ts index ad52e97669..67358d7c48 100644 --- a/modules/@angular/facade/test/async_spec.ts +++ b/modules/@angular/facade/test/async_spec.ts @@ -10,13 +10,7 @@ import { } from '@angular/core/testing/testing_internal'; import {AsyncTestCompleter} from '@angular/core/testing/testing_internal'; import {browserDetection} from '@angular/platform-browser/testing'; -import { - ObservableWrapper, - Observable, - Subject, - EventEmitter, - PromiseWrapper -} from '../src/async'; +import {ObservableWrapper, Observable, Subject, EventEmitter, PromiseWrapper} from '../src/async'; export function main() { describe('EventEmitter', () => { diff --git a/modules/@angular/integration_test/public_api_spec.ts b/modules/@angular/integration_test/public_api_spec.ts index 047e304e8b..a98ecf59ba 100644 --- a/modules/@angular/integration_test/public_api_spec.ts +++ b/modules/@angular/integration_test/public_api_spec.ts @@ -96,10 +96,7 @@ var COMMON: string[] = [ 'NgPluralCase' ]; -var COMMON_TESTING: string[] = [ - 'MockLocationStrategy', - 'SpyLocation' -]; +var COMMON_TESTING: string[] = ['MockLocationStrategy', 'SpyLocation']; var COMPILER: string[] = [ 'ElementSchemaRegistry', @@ -386,7 +383,7 @@ var PLATFORM_BROWSER: string[] = [ var PLATFORM_BROWSER_TESTING: string[] = [ 'TEST_BROWSER_STATIC_APPLICATION_PROVIDERS', 'TEST_BROWSER_STATIC_PLATFORM_PROVIDERS', - 'ADDITIONAL_TEST_BROWSER_PROVIDERS', // This should be made private + 'ADDITIONAL_TEST_BROWSER_PROVIDERS', // This should be made private 'BrowserDetection', 'DOMTestComponentRenderer', 'TestComponentRenderer', @@ -406,19 +403,13 @@ var PLATFORM_BROWSER_DYNAMIC: string[] = [ 'UrlChangeListener:dart' ]; -var PLATFORM_BROWSER_DYNAMIC_TESTING: string[] = [ - 'TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS', - 'TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS' -]; +var PLATFORM_BROWSER_DYNAMIC_TESTING: string[] = + ['TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS', 'TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS']; -var PLATFORM_SERVER: string[] = [ - 'Parse5DomAdapter' -]; +var PLATFORM_SERVER: string[] = ['Parse5DomAdapter']; -var PLATFORM_SERVER_TESTING: string[] = [ - 'TEST_SERVER_APPLICATION_PROVIDERS', - 'TEST_SERVER_PLATFORM_PROVIDERS' -]; +var PLATFORM_SERVER_TESTING: string[] = + ['TEST_SERVER_APPLICATION_PROVIDERS', 'TEST_SERVER_PLATFORM_PROVIDERS']; var UPGRADE: string[] = [ 'UpgradeAdapter', @@ -452,10 +443,7 @@ var HTTP: string[] = [ 'XHRConnection' ]; -var HTTP_TESTING: string[] = [ - 'MockBackend', - 'MockConnection' -]; +var HTTP_TESTING: string[] = ['MockBackend', 'MockConnection']; var ROUTER: string[] = [ 'AsyncRoute', @@ -480,8 +468,7 @@ var ROUTER: string[] = [ 'RouterOutlet' ]; -var ROUTER_TESTING: string[] = [ -]; +var ROUTER_TESTING: string[] = []; var API = { diff --git a/modules/@angular/platform-browser-dynamic/platform_browser_dynamic.ts b/modules/@angular/platform-browser-dynamic/platform_browser_dynamic.ts index d2aa7ce3ae..173df9613e 100644 --- a/modules/@angular/platform-browser-dynamic/platform_browser_dynamic.ts +++ b/modules/@angular/platform-browser-dynamic/platform_browser_dynamic.ts @@ -9,16 +9,17 @@ import {getDOM} from './platform_browser_private'; import {ReflectionCapabilities} from './core_private'; export const CACHED_TEMPLATE_PROVIDER: Array = - /*@ts2dart_const*/ [{provide: XHR, useClass: CachedXHR}]; + /*@ts2dart_const*/[{provide: XHR, useClass: CachedXHR}]; /** * An array of providers that should be passed into `application()` when bootstrapping a component. */ -export const BROWSER_APP_DYNAMIC_PROVIDERS: Array = /*@ts2dart_const*/ [ - BROWSER_APP_COMMON_PROVIDERS, - COMPILER_PROVIDERS, - {provide: XHR, useClass: XHRImpl}, -]; +export const BROWSER_APP_DYNAMIC_PROVIDERS: Array = + /*@ts2dart_const*/[ + BROWSER_APP_COMMON_PROVIDERS, + COMPILER_PROVIDERS, + {provide: XHR, useClass: XHRImpl}, + ]; @@ -91,11 +92,11 @@ export const BROWSER_APP_DYNAMIC_PROVIDERS: Array): Promise> { + appComponentType: Type, + customProviders?: Array): Promise> { reflector.reflectionCapabilities = new ReflectionCapabilities(); var appInjector = ReflectiveInjector.resolveAndCreate( - [BROWSER_APP_DYNAMIC_PROVIDERS, isPresent(customProviders) ? customProviders : []], - browserPlatform().injector); + [BROWSER_APP_DYNAMIC_PROVIDERS, isPresent(customProviders) ? customProviders : []], + browserPlatform().injector); return coreLoadAndBootstrap(appInjector, appComponentType); } diff --git a/modules/@angular/platform-browser-dynamic/platform_browser_private.ts b/modules/@angular/platform-browser-dynamic/platform_browser_private.ts index b3a3f8e11c..f3c064cc71 100644 --- a/modules/@angular/platform-browser-dynamic/platform_browser_private.ts +++ b/modules/@angular/platform-browser-dynamic/platform_browser_private.ts @@ -1,4 +1,4 @@ import {__platform_browser_private__ as _} from '@angular/platform-browser'; export type DomAdapter = _.DomAdapter; -export function getDOM(): _.DomAdapter { return _.getDOM() }; +export function getDOM(): _.DomAdapter{return _.getDOM()}; diff --git a/modules/@angular/platform-browser-dynamic/testing/browser.ts b/modules/@angular/platform-browser-dynamic/testing/browser.ts index f18a6b5e91..f1c0a116bd 100644 --- a/modules/@angular/platform-browser-dynamic/testing/browser.ts +++ b/modules/@angular/platform-browser-dynamic/testing/browser.ts @@ -9,10 +9,10 @@ import {BROWSER_APP_DYNAMIC_PROVIDERS} from '../index'; * Default platform providers for testing. */ export const TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: Array = - /*@ts2dart_const*/ [TEST_BROWSER_STATIC_PLATFORM_PROVIDERS]; + /*@ts2dart_const*/[TEST_BROWSER_STATIC_PLATFORM_PROVIDERS]; /** * Default application providers for testing. */ export const TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS: Array = - /*@ts2dart_const*/ [BROWSER_APP_DYNAMIC_PROVIDERS, ADDITIONAL_TEST_BROWSER_PROVIDERS]; + /*@ts2dart_const*/[BROWSER_APP_DYNAMIC_PROVIDERS, ADDITIONAL_TEST_BROWSER_PROVIDERS]; diff --git a/modules/@angular/platform-browser/core_private.ts b/modules/@angular/platform-browser/core_private.ts index 20e70dc5e9..fed2266f7c 100644 --- a/modules/@angular/platform-browser/core_private.ts +++ b/modules/@angular/platform-browser/core_private.ts @@ -4,6 +4,7 @@ export type RenderDebugInfo = t.RenderDebugInfo; export var RenderDebugInfo: typeof t.RenderDebugInfo = r.RenderDebugInfo; export var wtfInit: typeof t.wtfInit = r.wtfInit; export var ReflectionCapabilities: typeof t.ReflectionCapabilities = r.ReflectionCapabilities; -export var VIEW_ENCAPSULATION_VALUES: typeof t.VIEW_ENCAPSULATION_VALUES = r.VIEW_ENCAPSULATION_VALUES; +export var VIEW_ENCAPSULATION_VALUES: typeof t.VIEW_ENCAPSULATION_VALUES = + r.VIEW_ENCAPSULATION_VALUES; export type DebugDomRootRenderer = t.DebugDomRootRenderer; export var DebugDomRootRenderer: typeof t.DebugDomRootRenderer = r.DebugDomRootRenderer; diff --git a/modules/@angular/platform-browser/private_export.ts b/modules/@angular/platform-browser/private_export.ts index cc2e74d3c3..1885bffb80 100644 --- a/modules/@angular/platform-browser/private_export.ts +++ b/modules/@angular/platform-browser/private_export.ts @@ -11,13 +11,9 @@ export namespace __platform_browser_private__ { export type DomAdapter = dom_adapter.DomAdapter; export var DomAdapter = dom_adapter.DomAdapter; - export function getDOM():DomAdapter{ - return dom_adapter.getDOM(); - } + export function getDOM(): DomAdapter { return dom_adapter.getDOM(); } - export function setDOM(adapter:DomAdapter){ - return dom_adapter.setDOM(adapter); - } + export function setDOM(adapter: DomAdapter) { return dom_adapter.setDOM(adapter); } export var setRootDomAdapter = dom_adapter.setRootDomAdapter; @@ -27,7 +23,7 @@ export namespace __platform_browser_private__ { export type AnimationBuilder = animation_builder.AnimationBuilder; export var AnimationBuilder = animation_builder.AnimationBuilder; - export type CssAnimationBuilder = css_animation_builder.CssAnimationBuilder + export type CssAnimationBuilder = css_animation_builder.CssAnimationBuilder; export var CssAnimationBuilder = css_animation_builder.CssAnimationBuilder; export type CssAnimationOptions = css_animation_options.CssAnimationOptions; diff --git a/modules/@angular/platform-browser/src/animate/animation.ts b/modules/@angular/platform-browser/src/animate/animation.ts index 291ca70b7e..f5f5ec82a5 100644 --- a/modules/@angular/platform-browser/src/animate/animation.ts +++ b/modules/@angular/platform-browser/src/animate/animation.ts @@ -120,7 +120,8 @@ export class Animation { * @param classes */ removeClasses(classes: string[]): void { - for (let i = 0, len = classes.length; i < len; i++) getDOM().removeClass(this.element, classes[i]); + for (let i = 0, len = classes.length; i < len; i++) + getDOM().removeClass(this.element, classes[i]); } /** @@ -128,8 +129,9 @@ export class Animation { */ addEvents(): void { if (this.totalTime > 0) { - this.eventClearFunctions.push(getDOM().onAndCancel( - this.element, getDOM().getTransitionEnd(), (event: any) => this.handleAnimationEvent(event))); + this.eventClearFunctions.push( + getDOM().onAndCancel(this.element, getDOM().getTransitionEnd(), + (event: any) => this.handleAnimationEvent(event))); } else { this.handleAnimationCompleted(); } diff --git a/modules/@angular/platform-browser/src/animate/browser_details.ts b/modules/@angular/platform-browser/src/animate/browser_details.ts index 3275329b84..3c04fdcb21 100644 --- a/modules/@angular/platform-browser/src/animate/browser_details.ts +++ b/modules/@angular/platform-browser/src/animate/browser_details.ts @@ -14,7 +14,8 @@ export class BrowserDetails { */ doesElapsedTimeIncludesDelay(): void { var div = getDOM().createElement('div'); - getDOM().setAttribute(div, 'style', `position: absolute; top: -9999px; left: -9999px; width: 1px; + getDOM().setAttribute(div, 'style', + `position: absolute; top: -9999px; left: -9999px; width: 1px; height: 1px; transition: all 1ms linear 1ms;`); // Firefox requires that we wait for 2 frames for some reason this.raf((timestamp: any) => { diff --git a/modules/@angular/platform-browser/src/browser_common.ts b/modules/@angular/platform-browser/src/browser_common.ts index 87811ab74c..43fe217939 100644 --- a/modules/@angular/platform-browser/src/browser_common.ts +++ b/modules/@angular/platform-browser/src/browser_common.ts @@ -28,7 +28,7 @@ import { HAMMER_GESTURE_CONFIG, HammerGestureConfig, HammerGesturesPlugin -} from './dom/events/hammer_gestures' +} from './dom/events/hammer_gestures'; import {DomSharedStylesHost} from './dom/shared_styles_host'; import {AnimationBuilder} from './animate/animation_builder'; import {BrowserDetails} from './animate/browser_details'; @@ -97,7 +97,8 @@ export { } from '../src/dom/events/hammer_gestures' -export function initDomAdapter() { + export function + initDomAdapter() { BrowserDomAdapter.makeCurrent(); wtfInit(); BrowserGetTestability.init(); diff --git a/modules/@angular/platform-browser/src/dom/debug/ng_probe.ts b/modules/@angular/platform-browser/src/dom/debug/ng_probe.ts index 76499ec92c..8c23d79202 100644 --- a/modules/@angular/platform-browser/src/dom/debug/ng_probe.ts +++ b/modules/@angular/platform-browser/src/dom/debug/ng_probe.ts @@ -1,4 +1,11 @@ -import {DebugNode, getDebugNode, Provider, RootRenderer, NgZone, ApplicationRef} from '@angular/core'; +import { + DebugNode, + getDebugNode, + Provider, + RootRenderer, + NgZone, + ApplicationRef +} from '@angular/core'; import {DebugDomRootRenderer} from '../../../core_private'; import {assertionsEnabled} from '../../facade/lang'; import {getDOM} from '../dom_adapter'; diff --git a/modules/@angular/platform-browser/src/dom/dom_adapter.ts b/modules/@angular/platform-browser/src/dom/dom_adapter.ts index a768b0fab5..5cbc8e09d0 100644 --- a/modules/@angular/platform-browser/src/dom/dom_adapter.ts +++ b/modules/@angular/platform-browser/src/dom/dom_adapter.ts @@ -2,11 +2,11 @@ import {isBlank, Type} from '../../src/facade/lang'; var _DOM: DomAdapter = null; -export function getDOM(){ +export function getDOM() { return _DOM; } -export function setDOM(adapter:DomAdapter){ +export function setDOM(adapter: DomAdapter) { _DOM = adapter; } diff --git a/modules/@angular/platform-browser/src/dom/dom_renderer.ts b/modules/@angular/platform-browser/src/dom/dom_renderer.ts index 5e4a655380..2d06236765 100644 --- a/modules/@angular/platform-browser/src/dom/dom_renderer.ts +++ b/modules/@angular/platform-browser/src/dom/dom_renderer.ts @@ -7,7 +7,7 @@ import { RenderComponentType, ViewEncapsulation } from '@angular/core'; -import {RenderDebugInfo} from '../../core_private' +import {RenderDebugInfo} from '../../core_private'; import {AnimationBuilder} from '../animate/animation_builder'; import { isPresent, @@ -201,11 +201,12 @@ export class DomRenderer implements Renderer { var dashCasedPropertyName = camelCaseToDashCase(propertyName); if (getDOM().isCommentNode(renderElement)) { var existingBindings = RegExpWrapper.firstMatch( - TEMPLATE_BINDINGS_EXP, StringWrapper.replaceAll(getDOM().getText(renderElement), /\n/g, '')); + TEMPLATE_BINDINGS_EXP, + StringWrapper.replaceAll(getDOM().getText(renderElement), /\n/g, '')); var parsedBindings = Json.parse(existingBindings[1]); parsedBindings[dashCasedPropertyName] = propertyValue; getDOM().setText(renderElement, StringWrapper.replace(TEMPLATE_COMMENT_TEXT, '{}', - Json.stringify(parsedBindings))); + Json.stringify(parsedBindings))); } else { this.setElementAttribute(renderElement, propertyName, propertyValue); } diff --git a/modules/@angular/platform-browser/src/dom/events/key_events.ts b/modules/@angular/platform-browser/src/dom/events/key_events.ts index 010947ce81..381f75f53c 100644 --- a/modules/@angular/platform-browser/src/dom/events/key_events.ts +++ b/modules/@angular/platform-browser/src/dom/events/key_events.ts @@ -33,7 +33,7 @@ export class KeyEventsPlugin extends EventManagerPlugin { return this.manager.getZone().runOutsideAngular(() => { return getDOM().onAndCancel(element, StringMapWrapper.get(parsedEvent, 'domEventName'), - outsideHandler); + outsideHandler); }); } diff --git a/modules/@angular/platform-browser/src/platform_browser_static.ts b/modules/@angular/platform-browser/src/platform_browser_static.ts index 62de095ec1..b2c7b4aefa 100644 --- a/modules/@angular/platform-browser/src/platform_browser_static.ts +++ b/modules/@angular/platform-browser/src/platform_browser_static.ts @@ -9,7 +9,11 @@ import { } from '@angular/core'; import {Type, isPresent, isBlank} from './facade/lang'; -import {BROWSER_APP_COMMON_PROVIDERS, BROWSER_PROVIDERS, BROWSER_PLATFORM_MARKER} from './browser_common'; +import { + BROWSER_APP_COMMON_PROVIDERS, + BROWSER_PROVIDERS, + BROWSER_PLATFORM_MARKER +} from './browser_common'; export {ELEMENT_PROBE_PROVIDERS} from './dom/debug/ng_probe'; export {BrowserPlatformLocation} from './browser/location/browser_platform_location'; export { @@ -45,8 +49,8 @@ export function bootstrapStatic(appComponentType: Type, initReflector(); } - let appProviders = - isPresent(customProviders) ? [BROWSER_APP_STATIC_PROVIDERS, customProviders] : BROWSER_APP_STATIC_PROVIDERS; + let appProviders = isPresent(customProviders) ? [BROWSER_APP_STATIC_PROVIDERS, customProviders] : + BROWSER_APP_STATIC_PROVIDERS; var appInjector = ReflectiveInjector.resolveAndCreate(appProviders, browserStaticPlatform().injector); return coreLoadAndBootstrap(appInjector, appComponentType); diff --git a/modules/@angular/platform-browser/src/web_workers/ui/platform_location.ts b/modules/@angular/platform-browser/src/web_workers/ui/platform_location.ts index 6a1cc4abd9..f0aab782c6 100644 --- a/modules/@angular/platform-browser/src/web_workers/ui/platform_location.ts +++ b/modules/@angular/platform-browser/src/web_workers/ui/platform_location.ts @@ -4,10 +4,7 @@ import { import {UrlChangeListener} from '@angular/common'; import {Injectable} from '@angular/core/src/di'; import {ROUTER_CHANNEL} from '../shared/messaging_api'; -import { - ServiceMessageBrokerFactory, - ServiceMessageBroker -} from '../shared/service_message_broker'; +import {ServiceMessageBrokerFactory, ServiceMessageBroker} from '../shared/service_message_broker'; import {PRIMITIVE, Serializer} from '../shared/serializer'; import {bind} from './bind'; import {LocationType} from '../shared/serialized_types'; diff --git a/modules/@angular/platform-browser/src/webworker/worker_render_common.ts b/modules/@angular/platform-browser/src/webworker/worker_render_common.ts index fe924b3db3..57704b09ba 100644 --- a/modules/@angular/platform-browser/src/webworker/worker_render_common.ts +++ b/modules/@angular/platform-browser/src/webworker/worker_render_common.ts @@ -34,7 +34,9 @@ import { ClientMessageBrokerFactory, ClientMessageBrokerFactory_ } from '../web_workers/shared/client_message_broker'; -import {BrowserPlatformLocation} from '@angular/platform-browser/src/browser/location/browser_platform_location'; +import { + BrowserPlatformLocation +} from '@angular/platform-browser/src/browser/location/browser_platform_location'; import {Serializer} from '../web_workers/shared/serializer'; import {ON_WEB_WORKER} from '../web_workers/shared/api'; import {RenderStore} from '../web_workers/shared/render_store'; diff --git a/modules/@angular/platform-browser/src/worker_app.ts b/modules/@angular/platform-browser/src/worker_app.ts index 1233dd36f8..dbd217c9f4 100644 --- a/modules/@angular/platform-browser/src/worker_app.ts +++ b/modules/@angular/platform-browser/src/worker_app.ts @@ -12,10 +12,7 @@ import { assertPlatform } from '@angular/core'; -export { - WORKER_APP_PLATFORM, - WORKER_APP_APPLICATION_COMMON -} from './webworker/worker_app_common'; +export {WORKER_APP_PLATFORM, WORKER_APP_APPLICATION_COMMON} from './webworker/worker_app_common'; export {WORKER_APP_APPLICATION} from './webworker/worker_app'; export { ClientMessageBroker, diff --git a/modules/@angular/platform-browser/test/browser/bootstrap_spec.ts b/modules/@angular/platform-browser/test/browser/bootstrap_spec.ts index ab2bad20c3..0165065ee2 100644 --- a/modules/@angular/platform-browser/test/browser/bootstrap_spec.ts +++ b/modules/@angular/platform-browser/test/browser/bootstrap_spec.ts @@ -216,9 +216,10 @@ export function main() { it('should unregister change detectors when components are disposed', inject([AsyncTestCompleter], (async) => { var platform = createPlatform(ReflectiveInjector.resolveAndCreate(BROWSER_PROVIDERS)); - var app = ReflectiveInjector.resolveAndCreate([BROWSER_APP_DYNAMIC_PROVIDERS, testProviders], - platform.injector) - .get(ApplicationRef); + var app = + ReflectiveInjector.resolveAndCreate([BROWSER_APP_DYNAMIC_PROVIDERS, testProviders], + platform.injector) + .get(ApplicationRef); coreLoadAndBootstrap(app.injector, HelloRootCmp) .then((ref) => { ref.destroy(); diff --git a/modules/@angular/platform-browser/test/dom/events/event_manager_spec.ts b/modules/@angular/platform-browser/test/dom/events/event_manager_spec.ts index d04795eba2..4d2a19f9cf 100644 --- a/modules/@angular/platform-browser/test/dom/events/event_manager_spec.ts +++ b/modules/@angular/platform-browser/test/dom/events/event_manager_spec.ts @@ -12,7 +12,10 @@ import {DomEventsPlugin} from '@angular/platform-browser/src/dom/events/dom_even import {NgZone} from '@angular/core/src/zone/ng_zone'; import {ListWrapper, Map} from '../../../src/facade/collection'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; -import {EventManager, EventManagerPlugin} from '@angular/platform-browser/src/dom/events/event_manager'; +import { + EventManager, + EventManagerPlugin +} from '@angular/platform-browser/src/dom/events/event_manager'; import {el} from '../../../testing/browser_util'; export function main() { diff --git a/modules/@angular/platform-browser/test/testing_public_browser_spec.ts b/modules/@angular/platform-browser/test/testing_public_browser_spec.ts index b592cda601..de7756051c 100644 --- a/modules/@angular/platform-browser/test/testing_public_browser_spec.ts +++ b/modules/@angular/platform-browser/test/testing_public_browser_spec.ts @@ -66,7 +66,7 @@ export function main() { describe('test APIs for the browser', () => { describe('angular2 jasmine matchers', () => { describe('toHaveCssClass', () => { - it('should assert that the CSS class is present', () => { + it('should assert that the CSS class is present', () => { var el = document.createElement('div'); el.classList.add('matias'); expect(el).toHaveCssClass('matias'); diff --git a/modules/@angular/platform-browser/test/web_workers/worker/platform_location_spec.ts b/modules/@angular/platform-browser/test/web_workers/worker/platform_location_spec.ts index 0fc6748fda..c8f68cc2fc 100644 --- a/modules/@angular/platform-browser/test/web_workers/worker/platform_location_spec.ts +++ b/modules/@angular/platform-browser/test/web_workers/worker/platform_location_spec.ts @@ -8,7 +8,9 @@ import { } from '@angular/core/testing/testing_internal'; import {AsyncTestCompleter} from '@angular/core/testing/testing_internal'; import {SpyMessageBroker} from './spies'; -import {WebWorkerPlatformLocation} from '@angular/platform-browser/src/web_workers/worker/platform_location'; +import { + WebWorkerPlatformLocation +} from '@angular/platform-browser/src/web_workers/worker/platform_location'; import {LocationType} from '@angular/platform-browser/src/web_workers/shared/serialized_types'; import {MessageBus} from '@angular/platform-browser/src/web_workers/shared/message_bus'; import { diff --git a/modules/@angular/platform-browser/test/web_workers/worker/renderer_integration_spec.ts b/modules/@angular/platform-browser/test/web_workers/worker/renderer_integration_spec.ts index 219e9a7df5..802962f947 100644 --- a/modules/@angular/platform-browser/test/web_workers/worker/renderer_integration_spec.ts +++ b/modules/@angular/platform-browser/test/web_workers/worker/renderer_integration_spec.ts @@ -9,8 +9,8 @@ import { beforeEachProviders, } from '@angular/core/testing/testing_internal'; import {AsyncTestCompleter} from '@angular/core/testing/testing_internal'; -import { TestInjector } from '@angular/core/testing'; -import { TestComponentBuilder } from '@angular/compiler/testing'; +import {TestInjector} from '@angular/core/testing'; +import {TestComponentBuilder} from '@angular/compiler/testing'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; import { bind, @@ -89,8 +89,7 @@ export function main() { uiRenderStore = new RenderStore(); var testUiInjector = new TestInjector(); testUiInjector.platformProviders = TEST_BROWSER_STATIC_PLATFORM_PROVIDERS; - testUiInjector.applicationProviders = TEST_BROWSER_STATIC_APPLICATION_PROVIDERS - ; + testUiInjector.applicationProviders = TEST_BROWSER_STATIC_APPLICATION_PROVIDERS; testUiInjector.addProviders([ Serializer, provide(RenderStore, {useValue: uiRenderStore}), @@ -144,7 +143,7 @@ export function main() { it('should update any element property/attributes/class/style independent of the compilation on the root element and other elements', inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => { tcb.overrideView(MyComp2, new ViewMetadata( - {template: ''})) + {template: ''})) .createAsync(MyComp2) .then((fixture) => { var checkSetters = (componentRef, workerEl) => { @@ -225,7 +224,8 @@ export function main() { getRenderer(fixture.componentRef) .invokeElementMethod(el.nativeElement, 'setAttribute', ['a', 'b']); - expect(getDOM().getAttribute(getRenderElement(el.nativeElement), 'a')).toEqual('b'); + expect(getDOM().getAttribute(getRenderElement(el.nativeElement), 'a')) + .toEqual('b'); async.done(); }); })); diff --git a/modules/@angular/platform-browser/test/web_workers/worker/spies.ts b/modules/@angular/platform-browser/test/web_workers/worker/spies.ts index 8ed8f5a168..518b36b363 100644 --- a/modules/@angular/platform-browser/test/web_workers/worker/spies.ts +++ b/modules/@angular/platform-browser/test/web_workers/worker/spies.ts @@ -1,4 +1,6 @@ -import {ClientMessageBroker} from '@angular/platform-browser/src/web_workers/shared/client_message_broker'; +import { + ClientMessageBroker +} from '@angular/platform-browser/src/web_workers/shared/client_message_broker'; import {SpyObject, proxy} from '@angular/core/testing/testing_internal'; diff --git a/modules/@angular/platform-browser/testing/animation_builder_mock.ts b/modules/@angular/platform-browser/testing/animation_builder_mock.ts index a9dc14e20b..8098e4c547 100644 --- a/modules/@angular/platform-browser/testing/animation_builder_mock.ts +++ b/modules/@angular/platform-browser/testing/animation_builder_mock.ts @@ -1,9 +1,9 @@ import {Injectable} from '@angular/core'; -import { Animation } from '../src/animate/animation'; -import { CssAnimationOptions } from '../src/animate/css_animation_options'; -import { BrowserDetails } from '../src/animate/browser_details'; -import { AnimationBuilder } from '../src/animate/animation_builder'; -import { CssAnimationBuilder } from '../src/animate/css_animation_builder'; +import {Animation} from '../src/animate/animation'; +import {CssAnimationOptions} from '../src/animate/css_animation_options'; +import {BrowserDetails} from '../src/animate/browser_details'; +import {AnimationBuilder} from '../src/animate/animation_builder'; +import {CssAnimationBuilder} from '../src/animate/css_animation_builder'; @Injectable() export class MockAnimationBuilder extends AnimationBuilder { diff --git a/modules/@angular/platform-browser/testing/browser_static.ts b/modules/@angular/platform-browser/testing/browser_static.ts index 7e145131f7..7c38928f08 100644 --- a/modules/@angular/platform-browser/testing/browser_static.ts +++ b/modules/@angular/platform-browser/testing/browser_static.ts @@ -61,7 +61,4 @@ export const ADDITIONAL_TEST_BROWSER_PROVIDERS: Array = - /*@ts2dart_const*/[ - BROWSER_APP_COMMON_PROVIDERS, - ADDITIONAL_TEST_BROWSER_PROVIDERS - ]; + /*@ts2dart_const*/[BROWSER_APP_COMMON_PROVIDERS, ADDITIONAL_TEST_BROWSER_PROVIDERS]; diff --git a/modules/@angular/platform-browser/testing/browser_util.ts b/modules/@angular/platform-browser/testing/browser_util.ts index e8aa58510e..562b1892e7 100644 --- a/modules/@angular/platform-browser/testing/browser_util.ts +++ b/modules/@angular/platform-browser/testing/browser_util.ts @@ -4,7 +4,7 @@ import {isPresent, isString, RegExpWrapper, StringWrapper, RegExp} from '../src/ export class BrowserDetection { private _overrideUa: string; - private get _ua():string { + private get _ua(): string { if (isPresent(this._overrideUa)) { return this._overrideUa; } else { @@ -14,9 +14,7 @@ export class BrowserDetection { static setup() { browserDetection = new BrowserDetection(null); } - constructor(ua: string) { - this._overrideUa = ua; - } + constructor(ua: string) { this._overrideUa = ua; } get isFirefox(): boolean { return this._ua.indexOf('Firefox') > -1; } diff --git a/modules/@angular/platform-server/compiler_private.ts b/modules/@angular/platform-server/compiler_private.ts index 2205afac39..eab4092790 100644 --- a/modules/@angular/platform-server/compiler_private.ts +++ b/modules/@angular/platform-server/compiler_private.ts @@ -5,4 +5,3 @@ export var SelectorMatcher: typeof _.SelectorMatcher = _.SelectorMatcher; export type CssSelector = typeof _.CssSelector; export var CssSelector: typeof _.CssSelector = _.CssSelector; - diff --git a/modules/@angular/platform-server/src/parse5_adapter.ts b/modules/@angular/platform-server/src/parse5_adapter.ts index bc62973d30..f12042c7d5 100644 --- a/modules/@angular/platform-server/src/parse5_adapter.ts +++ b/modules/@angular/platform-server/src/parse5_adapter.ts @@ -2,14 +2,7 @@ var parse5 = require('parse5/index'); import {ListWrapper, StringMapWrapper} from '../src/facade/collection'; import {DomAdapter, setRootDomAdapter} from '../platform_browser_private'; -import { - isPresent, - isBlank, - global, - Type, - setValueOnPath, - DateWrapper -} from '../src/facade/lang'; +import {isPresent, isBlank, global, Type, setValueOnPath, DateWrapper} from '../src/facade/lang'; import {BaseException} from '../src/facade/exceptions'; import {SelectorMatcher, CssSelector} from '../compiler_private'; import {XHR} from '@angular/compiler'; diff --git a/modules/@angular/platform-server/testing/server.ts b/modules/@angular/platform-server/testing/server.ts index 1655444fb6..7e491b4831 100644 --- a/modules/@angular/platform-server/testing/server.ts +++ b/modules/@angular/platform-server/testing/server.ts @@ -23,7 +23,10 @@ import {DOCUMENT} from '@angular/platform-browser'; import {getDOM} from '../platform_browser_private'; import {RootRenderer} from '@angular/core'; import {DomRootRenderer, DomRootRenderer_} from '../../platform-browser/src/dom/dom_renderer'; -import {DomSharedStylesHost, SharedStylesHost} from '../../platform-browser/src/dom/shared_styles_host'; +import { + DomSharedStylesHost, + SharedStylesHost +} from '../../platform-browser/src/dom/shared_styles_host'; import { EventManager, EVENT_MANAGER_PLUGINS, diff --git a/modules/@angular/router/test/integration/bootstrap_spec.ts b/modules/@angular/router/test/integration/bootstrap_spec.ts index 3bbc49c4f9..a2e22a8661 100644 --- a/modules/@angular/router/test/integration/bootstrap_spec.ts +++ b/modules/@angular/router/test/integration/bootstrap_spec.ts @@ -40,7 +40,7 @@ import {MockLocationStrategy} from '@angular/common/testing'; import {ApplicationRef} from '@angular/core/src/application_ref'; import {MockApplicationRef} from '@angular/core/testing'; -//noinspection JSAnnotator +// noinspection JSAnnotator class DummyConsole implements Console { log(message) {} warn(message) {} diff --git a/modules/@angular/router/test/integration/router_link_spec.ts b/modules/@angular/router/test/integration/router_link_spec.ts index a0aa287494..b40e8e5559 100644 --- a/modules/@angular/router/test/integration/router_link_spec.ts +++ b/modules/@angular/router/test/integration/router_link_spec.ts @@ -197,15 +197,15 @@ export function main() { // adapter // can't handle css child selectors. expect(getDOM().getAttribute(fixture.debugElement.query(By.css('book-cmp')) - .query(By.css('a')) - .nativeElement, - 'href')) + .query(By.css('a')) + .nativeElement, + 'href')) .toEqual('/book/1984/page/100'); expect(getDOM().getAttribute(fixture.debugElement.query(By.css('page-cmp')) - .query(By.css('a')) - .nativeElement, - 'href')) + .query(By.css('a')) + .nativeElement, + 'href')) .toEqual('/book/1984/page/2'); async.done(); }); diff --git a/modules/@angular/router/test/integration/util.ts b/modules/@angular/router/test/integration/util.ts index 18a9cd1a64..acec3ce7a3 100644 --- a/modules/@angular/router/test/integration/util.ts +++ b/modules/@angular/router/test/integration/util.ts @@ -34,8 +34,9 @@ export class RootCmp { activatedCmp: any; } -export function compile(tcb: TestComponentBuilder, - template: string = ""): Promise> { +export function compile( + tcb: TestComponentBuilder, + template: string = ""): Promise> { return tcb.overrideTemplate(RootCmp, ('
' + template + '
')).createAsync(RootCmp); } diff --git a/modules/@angular/upgrade/src/upgrade_adapter.ts b/modules/@angular/upgrade/src/upgrade_adapter.ts index 39e7e9daa1..6a242dc355 100644 --- a/modules/@angular/upgrade/src/upgrade_adapter.ts +++ b/modules/@angular/upgrade/src/upgrade_adapter.ts @@ -364,7 +364,7 @@ export class UpgradeAdapter { (injector: angular.IInjectorService, rootScope: angular.IRootScopeService) => { ng1Injector = injector; ngZone.onMicrotaskEmpty.subscribe( - {next: (_) => ngZone.runOutsideAngular(() => rootScope.$apply())}); + {next: (_) => ngZone.runOutsideAngular(() => rootScope.$apply())}); UpgradeNg1ComponentAdapterBuilder.resolve(this.downgradedComponents, injector) .then(resolve, reject); } diff --git a/modules/angular2/src/alt_router/router.ts b/modules/angular2/src/alt_router/router.ts index fdc23d8730..2c5bc6751e 100644 --- a/modules/angular2/src/alt_router/router.ts +++ b/modules/angular2/src/alt_router/router.ts @@ -2,7 +2,12 @@ import {OnInit, provide, ReflectiveInjector, ComponentResolver} from '@angular/c import {RouterOutlet} from './directives/router_outlet'; import {Type, isBlank, isPresent} from '@angular/facade/src/lang'; import {ListWrapper} from '@angular/facade/src/collection'; -import {EventEmitter, Observable, PromiseWrapper, ObservableWrapper} from '@angular/facade/src/async'; +import { + EventEmitter, + Observable, + PromiseWrapper, + ObservableWrapper +} from '@angular/facade/src/async'; import {StringMapWrapper} from '@angular/facade/src/collection'; import {BaseException} from '@angular/core'; import {RouterUrlSerializer} from './router_url_serializer'; diff --git a/modules/angular2/src/alt_router/router_providers.ts b/modules/angular2/src/alt_router/router_providers.ts index 98694c646b..1dfb6a3c7b 100644 --- a/modules/angular2/src/alt_router/router_providers.ts +++ b/modules/angular2/src/alt_router/router_providers.ts @@ -1,7 +1,5 @@ import {ROUTER_PROVIDERS_COMMON} from './router_providers_common'; -import { - BrowserPlatformLocation -} from '@angular/platform-browser'; +import {BrowserPlatformLocation} from '@angular/platform-browser'; import {PlatformLocation} from '@angular/common'; export const ROUTER_PROVIDERS: any[] = /*@ts2dart_const*/[ diff --git a/modules/playground/src/web_workers/message_broker/index_common.ts b/modules/playground/src/web_workers/message_broker/index_common.ts index b8b1706d23..7707d87b02 100644 --- a/modules/playground/src/web_workers/message_broker/index_common.ts +++ b/modules/playground/src/web_workers/message_broker/index_common.ts @@ -1,6 +1,9 @@ import {PromiseWrapper} from '@angular/facade'; import {Component} from '@angular/core'; -import {ServiceMessageBrokerFactory, PRIMITIVE} from '../../../../@angular/platform-browser/src/worker_app'; +import { + ServiceMessageBrokerFactory, + PRIMITIVE +} from '../../../../@angular/platform-browser/src/worker_app'; const ECHO_CHANNEL = "ECHO"; diff --git a/modules/playground/src/web_workers/router/background_index.ts b/modules/playground/src/web_workers/router/background_index.ts index d6ca44d3a4..d113ed6b00 100644 --- a/modules/playground/src/web_workers/router/background_index.ts +++ b/modules/playground/src/web_workers/router/background_index.ts @@ -1,5 +1,8 @@ import {Provider} from '@angular/core'; -import {bootstrapApp, WORKER_APP_ROUTER} from '../../../../@angular/platform-browser/src/worker_app'; +import { + bootstrapApp, + WORKER_APP_ROUTER +} from '../../../../@angular/platform-browser/src/worker_app'; import {HashLocationStrategy, LocationStrategy} from '@angular/common'; import {App} from './index_common'; diff --git a/modules/playground/src/web_workers/router/index.ts b/modules/playground/src/web_workers/router/index.ts index 05e9035e7c..887d56a980 100644 --- a/modules/playground/src/web_workers/router/index.ts +++ b/modules/playground/src/web_workers/router/index.ts @@ -1,3 +1,6 @@ -import {bootstrapRender, WORKER_RENDER_ROUTER} from '../../../../@angular/platform-browser/src/worker_render'; +import { + bootstrapRender, + WORKER_RENDER_ROUTER +} from '../../../../@angular/platform-browser/src/worker_render'; bootstrapRender("loader.js", WORKER_RENDER_ROUTER); diff --git a/modules/rollup-test/hello_world.ts b/modules/rollup-test/hello_world.ts index 51b1e73840..7a3a37fbe4 100644 --- a/modules/rollup-test/hello_world.ts +++ b/modules/rollup-test/hello_world.ts @@ -1,12 +1,8 @@ import {Component} from '@angular/core'; import {bootstrap} from '@angular/platform-browser-dynamic'; -@Component({ - selector: 'hello-world', - template: 'hello world!!!' -}) +@Component({selector: 'hello-world', template: 'hello world!!!'}) class HelloWorldComponent { - } bootstrap(HelloWorldComponent); diff --git a/presubmit.sh b/presubmit.sh index 42ea99bd7f..8ff2e1a7f8 100755 --- a/presubmit.sh +++ b/presubmit.sh @@ -3,6 +3,8 @@ set -e -o pipefail cd `dirname $0` +gulp lint +gulp check-format export NODE_PATH=$NODE_PATH:$(pwd)/dist/all ./build.sh; $(npm bin)/tsc -p tools diff --git a/tools/cjs-jasmine/index.ts b/tools/cjs-jasmine/index.ts index d3873995d5..d7f7f2d027 100644 --- a/tools/cjs-jasmine/index.ts +++ b/tools/cjs-jasmine/index.ts @@ -31,28 +31,28 @@ if (globsIndex < 0) { args = process.argv.slice(globsIndex + 1); } -var specFiles = args.map(function(globstr) { - return glob.sync(globstr, { - cwd: distAll, - ignore: [ - // the following code and tests are not compatible with CJS/node environment - '@angular/platform-browser/**', - '@angular/platform-browser-dynamic/**', - '@angular/core/test/zone/**', - '@angular/core/test/fake_async_spec.*', - '@angular/common/test/forms/**', - '@angular/router/test/route_config/route_config_spec.*', - '@angular/router/test/integration/bootstrap_spec.*', - '@angular/integration_test/symbol_inspector/**', - '@angular/upgrade/**', - '@angular/examples/**', - 'angular1_router/**', - 'payload_tests/**' - ] - }); -}).reduce(function(specFiles, paths) { - return specFiles.concat(paths); -}, []); +var specFiles = + args.map(function(globstr) { + return glob.sync(globstr, { + cwd: distAll, + ignore: [ + // the following code and tests are not compatible with CJS/node environment + '@angular/platform-browser/**', + '@angular/platform-browser-dynamic/**', + '@angular/core/test/zone/**', + '@angular/core/test/fake_async_spec.*', + '@angular/common/test/forms/**', + '@angular/router/test/route_config/route_config_spec.*', + '@angular/router/test/integration/bootstrap_spec.*', + '@angular/integration_test/symbol_inspector/**', + '@angular/upgrade/**', + '@angular/examples/**', + 'angular1_router/**', + 'payload_tests/**' + ] + }); + }) + .reduce(function(specFiles, paths) { return specFiles.concat(paths); }, []); jasmine.DEFAULT_TIMEOUT_INTERVAL = 100; @@ -69,4 +69,3 @@ specFiles.forEach((file) => { if (r.main) r.main(); }); jrunner.execute(); - diff --git a/tools/cjs-jasmine/test-cjs-main.ts b/tools/cjs-jasmine/test-cjs-main.ts index b8d31f9a56..effc36f045 100644 --- a/tools/cjs-jasmine/test-cjs-main.ts +++ b/tools/cjs-jasmine/test-cjs-main.ts @@ -2,4 +2,4 @@ var testingPlatformServer = require('../../all/@angular/platform-server/testing/ var testing = require('../../all/@angular/core/testing'); testing.setBaseTestProviders(testingPlatformServer.TEST_SERVER_PLATFORM_PROVIDERS, - testingPlatformServer.TEST_SERVER_APPLICATION_PROVIDERS); + testingPlatformServer.TEST_SERVER_APPLICATION_PROVIDERS); diff --git a/tools/compiler_cli/src/static_reflector_spec.ts b/tools/compiler_cli/src/static_reflector_spec.ts index de486cc838..7ddc2a6e56 100644 --- a/tools/compiler_cli/src/static_reflector_spec.ts +++ b/tools/compiler_cli/src/static_reflector_spec.ts @@ -1,6 +1,13 @@ /// -import {describe, it, iit, expect, ddescribe, beforeEach} from '@angular/core/testing/testing_internal'; +import { + describe, + it, + iit, + expect, + ddescribe, + beforeEach +} from '@angular/core/testing/testing_internal'; import {isBlank} from '@angular/facade/src/lang'; import {ListWrapper} from '@angular/facade/src/collection'; diff --git a/tools/tsc-watch/index.ts b/tools/tsc-watch/index.ts index 5379b53d90..45fac69188 100644 --- a/tools/tsc-watch/index.ts +++ b/tools/tsc-watch/index.ts @@ -4,41 +4,51 @@ import {writeFileSync, mkdirSync, existsSync} from 'fs'; export * from './tsc_watch'; import 'reflect-metadata'; -const OFFLINE_COMPILE = [ - 'output/output_emitter_codegen_untyped', - 'output/output_emitter_codegen_typed', - 'offline_compiler_codegen_untyped', - 'offline_compiler_codegen_typed' -] +const OFFLINE_COMPILE = + [ + 'output/output_emitter_codegen_untyped', + 'output/output_emitter_codegen_typed', + 'offline_compiler_codegen_untyped', + 'offline_compiler_codegen_typed' + ] -function processOutputEmitterCodeGen():Promise { - return new Promise((resolve, reject) => { - var outDir = 'dist/all/@angular/compiler/test/'; - var promises = []; - console.log('Processing codegen...'); - OFFLINE_COMPILE.forEach((file: string) => { - var codegen = require('../../all/@angular/compiler/test/' + file + '.js'); - if (codegen.emit) { - console.log(` ${file} has changed, regenerating...`); - promises.push(Promise.resolve(codegen.emit()).then((code) => { - writeFileSync(outDir + file + '.ts', code); - })); - } - }); - if (promises.length) { - Promise.all(promises).then(() => { - var args = ['--project', 'tools/cjs-jasmine/tsconfig-output_emitter_codegen.json']; - console.log(' compiling changes: tsc ' + args.join(' ')); - var tsc = spawn(TSC, args, {stdio: 'pipe'}); - tsc.stdout.on('data', (data) => process.stdout.write(data)); - tsc.stderr.on('data', (data) => process.stderr.write(data)); - tsc.on('close', (code) => code ? reject('Tsc exited with: ' + code) : resolve(code)); - }).catch(reportError); - } else { - resolve(0); - } - }).catch(reportError); -} + function + processOutputEmitterCodeGen(): + Promise { + return new Promise((resolve, reject) => { + var outDir = 'dist/all/@angular/compiler/test/'; + var promises = []; + console.log('Processing codegen...'); + OFFLINE_COMPILE.forEach((file: string) => { + var codegen = require('../../all/@angular/compiler/test/' + file + '.js'); + if (codegen.emit) { + console.log(` ${file} has changed, regenerating...`); + promises.push( + Promise.resolve(codegen.emit()) + .then((code) => { writeFileSync(outDir + file + '.ts', code); })); + } + }); + if (promises.length) { + Promise.all(promises) + .then(() => { + var args = [ + '--project', + 'tools/cjs-jasmine/tsconfig-output_emitter_codegen.json' + ]; + console.log(' compiling changes: tsc ' + args.join(' ')); + var tsc = spawn(TSC, args, {stdio: 'pipe'}); + tsc.stdout.on('data', (data) => process.stdout.write(data)); + tsc.stderr.on('data', (data) => process.stderr.write(data)); + tsc.on('close', (code) => code ? reject('Tsc exited with: ' + code) : + resolve(code)); + }) + .catch(reportError); + } else { + resolve(0); + } + }) + .catch(reportError); + } function md(dir: string, folders: string[]) { if (folders.length) { @@ -72,12 +82,9 @@ if (platform == 'node') { start: 'File change detected. Starting incremental compilation...', error: 'error', complete: 'Compilation complete. Watching for file changes.', - onStartCmds: [ - ['node', 'node_modules/karma/bin/karma', 'start', '--no-auto-watch', 'karma-js.conf.js'] - ], - onChangeCmds: [ - ['node', 'node_modules/karma/bin/karma', 'run', 'karma-js.conf.js'] - ] + onStartCmds: + [['node', 'node_modules/karma/bin/karma', 'start', '--no-auto-watch', 'karma-js.conf.js']], + onChangeCmds: [['node', 'node_modules/karma/bin/karma', 'run', 'karma-js.conf.js']] }); } diff --git a/tools/tsc-watch/tsc_watch.ts b/tools/tsc-watch/tsc_watch.ts index 3735a62625..e64f5a77f6 100644 --- a/tools/tsc-watch/tsc_watch.ts +++ b/tools/tsc-watch/tsc_watch.ts @@ -2,27 +2,33 @@ import {spawn} from 'child_process'; import {resolve} from 'url'; enum State { - idle, waiting, error + idle, + waiting, + error } export const TSC = 'node_modules/typescript/bin/tsc'; export type Command = (stdIn, stdErr) => Promise; export class TscWatch { - private tsconfig:string; - private start:string|RegExp; - private error:string|RegExp; - private complete:string|RegExp; - private onStartCmds:Array; - private onChangeCmds:Array; - private state:State; - private triggered:Promise = null; + private tsconfig: string; + private start: string | RegExp; + private error: string | RegExp; + private complete: string | RegExp; + private onStartCmds: Array; + private onChangeCmds: Array; + private state: State; + private triggered: Promise = null; private runOnce: boolean = false; - constructor({tsconfig, start, error, complete, onStartCmds=null, onChangeCmds=null}: - {tsconfig:string, error:string|RegExp, start:string, complete:string, - onStartCmds?:Array, onChangeCmds?:Array}) - { + constructor({tsconfig, start, error, complete, onStartCmds = null, onChangeCmds = null}: { + tsconfig: string, + error: string | RegExp, + start: string, + complete: string, + onStartCmds?: Array, + onChangeCmds?: Array + }) { console.log('Watching:', tsconfig, 'in', process.cwd()); this.tsconfig = tsconfig; this.start = start; @@ -35,7 +41,8 @@ export class TscWatch { watch() { var args = [TSC, '--project', this.tsconfig]; if (!this.runOnce) args.push('--watch'); - var tsc = this.runCmd(args, {}, (d) => this.consumeLine(d, false), (d) => this.consumeLine(d, true)); + var tsc = + this.runCmd(args, {}, (d) => this.consumeLine(d, false), (d) => this.consumeLine(d, true)); if (this.runOnce) { tsc.then(() => this.triggerCmds(), code => process.exit(code)); } @@ -43,27 +50,27 @@ export class TscWatch { this.onStartCmds.forEach((cmd) => this.runCmd(cmd, () => null, () => null)); } - private runCmd(argsOrCmd: string[]|Command, env?, - stdOut = pipeStdOut, stdErr = pipeStdErr):Promise - { + private runCmd(argsOrCmd: string[] | Command, env?, stdOut = pipeStdOut, + stdErr = pipeStdErr): Promise { if (typeof argsOrCmd == 'function') { return (argsOrCmd as Command)(stdErr, stdOut); } else if (argsOrCmd instanceof Array) { var args = argsOrCmd as Array; return new Promise((resolve, reject) => { - var [cmd, ...options] = args; - console.log('=====>', cmd, options.join(' ')); - var childProcess = spawn(cmd, options, {stdio: 'pipe'}); - childProcess.stdout.on('data', stdOut); - childProcess.stderr.on('data', stdErr); - var onExit = () => childProcess.kill(); - childProcess.on('close', (code: number) => { - process.removeListener('exit', onExit); - console.log('EXIT:', code, '<=====', args.join(' ')); - code ? reject(code) : resolve(code); - }); - process.on('exit', onExit); - }).catch(reportError); + var [cmd, ...options] = args; + console.log('=====>', cmd, options.join(' ')); + var childProcess = spawn(cmd, options, {stdio: 'pipe'}); + childProcess.stdout.on('data', stdOut); + childProcess.stderr.on('data', stdErr); + var onExit = () => childProcess.kill(); + childProcess.on('close', (code: number) => { + process.removeListener('exit', onExit); + console.log('EXIT:', code, '<=====', args.join(' ')); + code ? reject(code) : resolve(code); + }); + process.on('exit', onExit); + }) + .catch(reportError); } else { throw new Error('Expecting function or an array of strings...'); } @@ -74,7 +81,7 @@ export class TscWatch { this.watch(); } - consumeLine(buffer:Buffer, isStdError:boolean) { + consumeLine(buffer: Buffer, isStdError: boolean) { var line = '' + buffer; if (contains(line, this.start)) { console.log('=============================================================================='); @@ -92,7 +99,8 @@ export class TscWatch { this.state = State.idle; } else { if (this.triggered) { - this.triggered.then(() => this.triggerCmds(), (e) => {console.log("Error while running commands....", e)}); + this.triggered.then(() => this.triggerCmds(), + (e) => {console.log("Error while running commands....", e)}); } else { this.triggerCmds(); } @@ -103,12 +111,10 @@ export class TscWatch { } triggerCmds() { - var cmdPromise:Promise = Promise.resolve(); - this.onChangeCmds.forEach((cmd:string[]|Command) => { - cmdPromise = cmdPromise.then(() => { - return this.runCmd(cmd); - }) - }); + var cmdPromise: Promise = Promise.resolve(); + this.onChangeCmds.forEach((cmd: string[] | Command) => {cmdPromise = cmdPromise.then(() => { + return this.runCmd(cmd); + })}); cmdPromise.then(() => this.triggered = null, (code) => { if (this.runOnce) { if (typeof code != 'number') { @@ -116,7 +122,7 @@ export class TscWatch { process.exit(1); } process.exit(code); - } else { + } else { this.triggered = null; } }); @@ -124,7 +130,7 @@ export class TscWatch { } } -function stdOut(data:Buffer, isStdError:boolean) { +function stdOut(data: Buffer, isStdError: boolean) { if (isStdError) { process.stderr.write(data); } else { @@ -132,7 +138,7 @@ function stdOut(data:Buffer, isStdError:boolean) { } } -function contains(line: string, text: string| RegExp): boolean { +function contains(line: string, text: string | RegExp): boolean { if (typeof text == 'string') { return line.indexOf(text as string) != -1; } else if (text instanceof RegExp) { @@ -153,5 +159,9 @@ export function reportError(e) { return Promise.reject(e); } -function pipeStdOut(d) { process.stdout.write(d); } -function pipeStdErr(d) { process.stderr.write(d); } +function pipeStdOut(d) { + process.stdout.write(d); +} +function pipeStdErr(d) { + process.stderr.write(d); +}