feat(forms): Added emitEvent to AbstractControl methods (#11949)

* feat(forms): Added emitEvent to AbstractControl methods

* style(forms): unified named parameter
This commit is contained in:
Florian Kinder
2016-10-19 18:54:54 +02:00
committed by Alex Rickabaugh
parent 592f40aa9c
commit b9fc090143
5 changed files with 127 additions and 43 deletions

View File

@ -555,6 +555,16 @@ export function main() {
expect(logger).toEqual(['control1', 'group']);
});
it('should not fire an event when explicitly specified', fakeAsync(() => {
g.valueChanges.subscribe((value) => { throw 'Should not happen'; });
c.valueChanges.subscribe((value) => { throw 'Should not happen'; });
c2.valueChanges.subscribe((value) => { throw 'Should not happen'; });
c.reset(null, {emitEvent: false});
tick();
}));
it('should emit one statusChange event per reset control', () => {
g.statusChanges.subscribe(() => logger.push('group'));
c.statusChanges.subscribe(() => logger.push('control1'));