333a708bb6
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 |
||
---|---|---|
.. | ||
animations | ||
benchpress | ||
common | ||
compiler | ||
compiler-cli | ||
core | ||
docs | ||
examples | ||
forms | ||
http | ||
language-service | ||
platform-browser | ||
platform-browser-dynamic | ||
platform-server | ||
platform-webworker | ||
platform-webworker-dynamic | ||
router | ||
tsc-wrapped | ||
upgrade | ||
README.md | ||
empty.ts | ||
es6-subset.d.ts | ||
license-banner.txt | ||
system.d.ts | ||
tsconfig.json | ||
types.d.ts |
README.md
Angular
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
License: MIT