angular-cn/packages/forms/test
Kara 333a708bb6 feat(forms): add updateOn blur option to FormControls (#18408)
By default, the value and validation status of a `FormControl` updates
whenever its value changes. If an application has heavy validation
requirements, updating on every text change can sometimes be too expensive.

This commit introduces a new option that improves performance by delaying
form control updates until the "blur" event.  To use it, set the `updateOn`
option to `blur` when instantiating the `FormControl`.

```ts
// example without validators
const c = new FormControl(, { updateOn: blur });

// example with validators
const c= new FormControl(, {
   validators: Validators.required,
   updateOn: blur
});
```

Like in AngularJS, setting `updateOn` to `blur` will delay the update of
the value as well as the validation status. Updating value and validity
together keeps the system easy to reason about, as the two will always be
in sync. It's  also worth noting that the value/validation pipeline does
still run when the form is initialized (in order to support initial values).

Closes #7113
2017-08-02 18:10:10 -07:00
..
directives_spec.ts fix(forms): Update types for TypeScript nullability support 2017-04-18 12:07:33 -07:00
form_array_spec.ts feat(forms): add options arg to abstract controls 2017-07-31 11:29:32 -07:00
form_builder_spec.ts build: fix file paths after moving modules/@angular/* to packages/* 2017-03-08 16:29:28 -08:00
form_control_spec.ts feat(forms): add updateOn blur option to FormControls (#18408) 2017-08-02 18:10:10 -07:00
form_group_spec.ts refactor(forms): compile forms cleanly with TypeScript 2.4 (#18462) 2017-08-02 16:29:31 -07:00
reactive_integration_spec.ts feat(forms): add updateOn blur option to FormControls (#18408) 2017-08-02 18:10:10 -07:00
spies.ts build: fix file paths after moving modules/@angular/* to packages/* 2017-03-08 16:29:28 -08:00
template_integration_spec.ts refactor(forms): move value accessor tests into own spec (#18356) 2017-07-26 17:55:37 -05:00
validators_spec.ts fix(forms): fix min and max validator behavior on non-numbers 2017-06-08 13:59:17 -07:00
value_accessor_integration_spec.ts build: enable TSLint on the packages folder 2017-07-31 15:47:57 -07:00