Skip to content

Commit

Permalink
docs(changelog): add the ngModel is now fully async note
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorMinar committed Aug 9, 2016
1 parent d75502e commit f444c11
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit f444c11

Please sign in to comment.