Permalink
Browse files

docs(changelog): add the ngModel is now fully async note

  • Loading branch information...
IgorMinar committed Aug 9, 2016
1 parent d75502e commit f444c11d218d26ac817d5f3b12e19c6b4b8d2390
Showing with 21 additions and 0 deletions.
  1. +21 −0 CHANGELOG.md
@@ -491,6 +491,27 @@
let upgradeAdapter = new UpgradeAdapter(MyModule);
```

* ngModel: `ngModel` is now always asynchronous when updating. This means that in tests, instead of calling `ComponentFixture.detectChanges`, you'll need to use `ComponentFixture.whenStable`, which is asynchronous.

Before:

```js
let fixture = TestBed.createComponent(InputComp);
fixture.detectChanges();
let inputBox = <HTMLInputElement> fixture.debugElement.query(By.css('input')).nativeElement;
expect(inputBox.value).toEqual('Original Name');
```

After:
```js
let fixture = TedBed.createComponent(InputComp);
fixture.whenStable().then(() => {
let inputBox = <HTMLInputElement> fixture.debugElement.query(By.css('input')).nativeElement;
expect(inputBox.value).toEqual('Original Name');
});
```



<a name="2.0.0-rc.4"></a>

0 comments on commit f444c11

Please sign in to comment.