Deliver web apps with confidence 🚀
Find a file
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
.circleci build: update bazel rules to latest (#18289) 2017-07-21 18:09:44 -05:00
.github docs: does please -> does (#18044) 2017-07-11 11:46:57 -07:00
aio fix(aio): fix layout of the webpack guide (#18493) 2017-08-02 16:00:36 -07:00
docs docs: improve github labels by introducing "PR target" labels (#18436) 2017-08-02 15:30:36 -07:00
integration refactor(tsc-wrapped): move tsc-wrapped to the packages directory (#18160) 2017-07-21 12:26:16 -05:00
modules refactor(tsc-wrapped): move tsc-wrapped to the packages directory (#18160) 2017-07-21 12:26:16 -05:00
packages feat(forms): add updateOn blur option to FormControls (#18408) 2017-08-02 18:10:10 -07:00
scripts ci: remove chromium fold reference (#18445) 2017-08-02 15:43:26 -07:00
tools feat(router): add events tracking activation of individual routes 2017-08-01 10:44:00 -07:00
.bazelrc build: Introduce Bazel build rules 2017-06-05 11:18:20 -07:00
.bowerrc chore(dgeni): clean up legacy typings bundle creation 2015-10-29 21:19:59 +00:00
.clang-format feat(tooling): Add a .clang-format for automated JavaScript formatting. 2015-04-02 08:44:34 -07:00
.editorconfig chore(.editorconfig): include markdown config 2015-01-27 00:14:48 -08:00
.gitattributes chore: force lf EOL for ts files (#11143) 2016-08-29 12:41:58 -07:00
.gitignore test: git ignore e2e test folders (#17984) 2017-07-11 11:55:24 -07:00
.nvmrc ci: bump node version to 6.9.5 and npm to 3.10.7 2017-02-02 23:28:00 -08:00
.pullapprove.yml ci: give ownership of ngc-wrapped to compiler-cli maintainers (#18354) 2017-07-26 17:55:24 -05:00
.travis.yml ci: shard the aio example e2e tests 2017-07-28 15:28:28 -07:00
bower.json docs: branding fixes (#14132) 2017-01-27 15:03:11 -06:00
browser-providers.conf.js ci: disable Android 4.1, 4.2 and 4.3 in SauceLabs (#14461) 2017-03-16 09:13:07 -07:00
BUILD.bazel build: update bazel rules to latest (#18289) 2017-07-21 18:09:44 -05:00
build.sh refactor(tsc-wrapped): update tsc-wrapped to pass strictNullCheck (#18160) 2017-07-21 12:26:20 -05:00
CHANGELOG.md docs: changelog for 5.0.0-beta.2 release 2017-08-02 13:23:27 -07:00
CONTRIBUTING.md docs: improve grammar and wording on CONTRIBUTING.md (#17855) 2017-07-11 12:40:30 -07:00
gulpfile.js build: fix public-api:update gulp task (#16859) 2017-05-22 11:07:21 -06:00
karma-js.conf.js refactor(tsc-wrapped): move tsc-wrapped to the packages directory (#18160) 2017-07-21 12:26:16 -05:00
LICENSE style(docs): update copyright years (#13736) 2017-01-27 20:47:14 -08:00
npm-shrinkwrap.clean.json build: update bazel rules to latest (#18289) 2017-07-21 18:09:44 -05:00
npm-shrinkwrap.json build: update bazel rules to latest (#18289) 2017-07-21 18:09:44 -05:00
npm-shrinkwrap.readme.md chore(lint): replace gulp check-task with tslint no-jasmine-focus rule 2016-10-28 15:53:15 -07:00
package.json release: cut the 5.0.0-beta.2 release 2017-08-02 13:21:07 -07:00
protractor-e2e.conf.js refactor: add license header to JS files & format files (#12081) 2016-10-04 20:39:20 -07:00
protractor-examples-e2e.conf.js refactor: format and lint code 2016-12-12 11:30:25 -08:00
protractor-perf.conf.js refactor: add license header to JS files & format files (#12081) 2016-10-04 20:39:20 -07:00
README.md docs: Unbreak README Formatting (#18043) 2017-07-11 11:48:37 -07:00
shims_for_IE.js Revert "refactor: add license header to JS files & format files (#12035)" 2016-10-04 14:06:41 -07:00
test-main.js feat(common): new HttpClient API 2017-07-07 12:09:32 -07:00
test.sh refactor(tsc-wrapped): move tsc-wrapped to the packages directory (#18160) 2017-07-21 12:26:16 -05:00
tslint.json build(tslint): enable no-inner-declarations (#13316) 2016-12-08 13:46:08 -08:00
WORKSPACE build: update bazel rules to latest (#18289) 2017-07-21 18:09:44 -05:00

Build Status CircleCI Join the chat at https://gitter.im/angular/angular Issue Stats Issue Stats npm version

Sauce Test Status

Safari (7+), iOS (7+), Edge (14) and IE mobile (11) are tested on BrowserStack.

Angular

Angular is a development platform for building mobile and desktop web applications using Typescript/JavaScript and other languages.

Quickstart

Get started in 5 minutes.

Want to help?

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.