angular-docs-cn/packages/forms/test
Andrew Kushnir e96b379385 fix(forms): remove validators while cleaning up a control (#39234)
Prior to this commit, the `cleanUpControl` function (responsible for cleaning up control instance)
was not taking validators into account. As a result, these validators remain registered on a detached
form control instance, thus causing memory leaks. This commit updates the `cleanUpControl` function
logic to also run validators cleanup.

As a part of this change, the logic to setup and cleanup validators was refactored and moved to
separate functions (with completely opposite behavior), so that they can be reused in the future.

This commit doesn't add the `cleanUpControl` calls to all possible places, it just fixes the cases
where this function is being called, but doesn't fully perform a cleanup. The `cleanUpControl`
function calls will be added to other parts of code (to avoid more memory leaks) in a followup PR.

PR Close #39234
2020-11-04 10:58:24 -08:00
..
BUILD.bazel test: disable failing saucelabs tests (#36620) 2020-04-14 10:13:33 -07:00
directives_spec.ts refactor(forms): move common validators-related logic to the `AbstractControlDirective` class (#38280) 2020-10-28 09:48:20 -07:00
form_array_spec.ts refactor(forms): refactor common validators used in unit tests (#38020) 2020-07-22 20:42:43 -07:00
form_builder_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
form_control_spec.ts refactor(forms): refactor common validators used in unit tests (#38020) 2020-07-22 20:42:43 -07:00
form_group_spec.ts fix(forms): ensure to emit `statusChanges` on subsequent value update/validations (#38354) 2020-09-01 10:36:31 -07:00
reactive_integration_spec.ts fix(forms): remove validators while cleaning up a control (#39234) 2020-11-04 10:58:24 -08:00
spies.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
template_integration_spec.ts feat(core): update reference and doc to change `async` to `waitAsync`. (#37583) 2020-08-03 12:54:13 -07:00
util.ts refactor(forms): refactor common validators used in unit tests (#38020) 2020-07-22 20:42:43 -07:00
validators_spec.ts refactor(forms): get rid of duplicate functions (#38371) 2020-08-07 11:40:04 -07:00
value_accessor_integration_spec.ts feat(core): update reference and doc to change `async` to `waitAsync`. (#37583) 2020-08-03 12:54:13 -07:00