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