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

This commit is contained in:
Igor Minar 2016-08-09 10:54:54 -07:00
parent d75502eeee
commit f444c11d21
1 changed files with 21 additions and 0 deletions

View File

@ -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>