angular/packages
Kristiyan Kostadinov ebf2fc5224 fix(forms): incorrectly keeping track of ngModel with ngFor inside a form (#40459)
When an `NgModel` is created within a `form`, it receives an `NgControl` based on its `name`, but
the control doesn't get swapped out if the name changes. This can lead to problems if the `NgModel`
is part of an `ngFor`, because the name can change based on its position in the list and a new
control can be defined with the same name, leading us to having multiple directives pointing to
the same control. For example, if we start off with a list like :

```
[0, 1, 2]; -> [NgModel(0), NgModel(1), NgModel(2)]
```

Then we remove the second item:

```
[0, 2]; -> [NgModel(0), NgModel(2)]
```

And finally, if we decide to add an item to the end of the list, we'll already have a control for
index 2, causing the list to look like:

```
[0, 2, 3]; -> [NgModel(0), NgModel(2), NgModel(2)]
```

These changes fix the issue by removing the old control when the `name` of the directive changes.

Fixes #38465.
Fixes #37920.

PR Close #40459
2022-02-07 13:16:10 -08:00
..
animations fix(animations): implement missing transition delay (#44799) 2022-02-03 23:54:16 +00:00
bazel refactor(compiler-cli): remove leftover _extendedTemplateDiagnostics flag (#44920) 2022-02-01 18:24:10 +00:00
benchpress build: bump version for @angular/benchpress to v0.3.0 (#44893) 2022-01-31 21:27:08 +00:00
common perf(http): remove IE special status handling (#44354) 2022-02-04 11:45:15 -08:00
compiler fix(compiler): allow banana-in-a-box bindings to end with non-null assertion (#37809) 2022-02-07 10:46:52 -08:00
compiler-cli feat(compiler-cli): initial implementation of standalone components (#44812) 2022-02-03 08:55:25 -08:00
core fix(core): input coercion (#42803) 2022-02-07 10:52:59 -08:00
docs refactor: fix various typos across different packages (#44523) 2022-01-07 18:11:10 +00:00
elements refactor(elements): remove the createCustomEvent function (#44703) 2022-01-13 18:26:54 +00:00
examples test: clean up more entryComponents usages (#44561) 2022-01-06 18:36:22 +00:00
forms fix(forms): incorrectly keeping track of ngModel with ngFor inside a form (#40459) 2022-02-07 13:16:10 -08:00
language-service refactor(compiler-cli): remove leftover _extendedTemplateDiagnostics flag (#44920) 2022-02-01 18:24:10 +00:00
localize build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00
misc/angular-in-memory-web-api build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00
platform-browser fix(platform-browser): Make transfer state key typesafe. (#23020) 2022-02-03 22:46:50 -08:00
platform-browser-dynamic docs: deprecate CachedResourceLoader and RESOURCE_CACHE_PROVIDER symbols (#44749) 2022-01-19 09:42:40 -08:00
platform-server fix(core): consistently use namespace short name rather than URI (#44766) 2022-01-21 11:19:30 -08:00
private/testing test: remove Ivy/ViewEngine switch helpers and obsolete tests (#44120) 2021-11-24 19:42:39 +00:00
router fix(core): input coercion (#42803) 2022-02-07 10:52:59 -08:00
service-worker build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00
upgrade build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00
zone.js build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00
BUILD.bazel build: Auto-gen tsec tsconfig files (#43440) 2021-09-17 17:17:34 +00:00
circular-deps-test.conf.js fix(platform-webworker): remove platform-webworker and platform-webworker-dynamic (#38846) 2020-09-30 09:13:59 -04:00
empty.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
goog.d.ts refactor(core): replace references to goog.LOCALE with goog.getLocale() (#43089) 2021-08-10 10:35:26 -07:00
license-banner.txt build: bump license year (#44590) 2022-01-04 12:05:25 -08:00
README.md docs: add doc reference to npm package readme (#33911) 2019-11-20 14:46:23 -08:00
system.d.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
tsconfig-build.json build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00
tsconfig-legacy-saucelabs.json build: bundle spec files for saucelabs legacy job (#44281) 2021-11-30 11:56:04 -05:00
tsconfig-test.json build: switch devmode output to es2015 (#44505) 2022-01-05 23:20:20 +00:00
tsconfig-tsec-base.json build: update tsconfigs to use ES2020 as target and module (#43431) 2021-10-01 18:28:42 +00:00
tsconfig.json build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00
tsec-exemption.json build: Enable tsec checks for critical packages. (#43108) 2021-09-13 14:45:57 -07:00
types.d.ts build: replace @types/trusted-types dep with minimal type defs (#39211) 2020-10-15 09:08:00 -07:00

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

Usage information and reference details can be found in Angular documentation.

License: MIT