You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Forms should throw error if two or more NgModels appear in form with the same name #13993
Forms should throw error if duplicate names are detected.
What is the motivation / use case for changing the behavior?
This leads to unpredictable results (value overwrites) which are difficult to find.
Angular version: 2.4.3
Browser: [all]
Language: [all]
Reacted by Alexander Turtsevich, hansi_reit, Andrew Polemeni, ( Nechiforel David-Samuel ) NsdHSO , Belal, johnny kim, Roman Kuhta, Gleb Kan, Ajay Anil Raut, Steffen Schanze and 1 more
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.
We'd likely accept a contribution in this area, and it's good for a first-time contributor. The message would go in forms/src/directives/template_driven_errors.ts, and the check would be somewhere in forms/src/directives.
How do I build Angular source code? When I run npm install I get the below error:
`PS C:\code\angular> npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/typescript
npm ERR! typescript@"~4.7.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer typescript@">=4.4.2 <4.7" from @angular/[email protected]
npm ERR! node_modules/@angular/compiler-cli
npm ERR! peer @angular/compiler-cli@"^13.0.0 || ^13.3.0-rc.0" from @angular-devkit/[email protected]
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\pvaddepa\AppData\Local\npm-cache_logs\2022-06-08T19_35_31_088Z-debug.log`
Even npm install --force errors out. I am using node 16.10.0
@kemsky, I acknowledge that the following issue is pretty old. But, while navigating the good-first-issue, I encountered these as open, so I wanted to check them out.
I was trying the following code block, and it seems to not cause any concerns with the values.
Prompting an error for the name property seems counterintuitive, as it's not being used to manage the values.
Do we really require an error to notify it, or a warning, or ignoring might suffice?
<inputname="entireStateCoverage"
type="checkbox"
[(ngModel)]="title"
#titleInput="ngModel"
/><inputname="entireStateCoverage"
type="checkbox"
[(ngModel)]="active"
#activeInput="ngModel"
/><div>{{ title }}</div><div>{{ active }}</div><div>---</div><div>{{ titleInput.value }}</div><div>{{ activeInput.value }}</div>
I'd like to take this one (Forms should throw error if two or more NgModels appear in f). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)
I'd like to take this one (Forms should throw error if two or more NgModels appear in f). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)
I'd like to take this one (Forms should throw error if two or more NgModels appear in f). I'll dig into the root cause and follow up with a PR shortly. (claiming via @LeonxLJX)
Activity
angular-robot commentedon Jun 4, 2021
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.
Find more details about Angular's feature request process in our documentation.
angular-robot commentedon Jun 25, 2021
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.
dylhunn commentedon Jun 6, 2022
We'd likely accept a contribution in this area, and it's good for a first-time contributor. The message would go in
forms/src/directives/template_driven_errors.ts, and the check would be somewhere informs/src/directives.phalgunv commentedon Jun 7, 2022
I'd like to work on this issue.
phalgunv commentedon Jun 8, 2022
How do I build Angular source code? When I run
npm installI get the below error:`PS C:\code\angular> npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/typescript
npm ERR! typescript@"~4.7.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer typescript@">=4.4.2 <4.7" from @angular/[email protected]
npm ERR! node_modules/@angular/compiler-cli
npm ERR! peer @angular/compiler-cli@"^13.0.0 || ^13.3.0-rc.0" from @angular-devkit/[email protected]
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\pvaddepa\AppData\Local\npm-cache_logs\2022-06-08T19_35_31_088Z-debug.log`
Even
npm install --forceerrors out. I am using node 16.10.0Please let me know what I'm missing.
13 remaining items
vp4140 commentedon Sep 7, 2023
Hey @dylhunn , I'm interested in continuing working on the above mentioned PR.
tghimanshu commentedon Sep 22, 2025
@kemsky, I acknowledge that the following issue is pretty old. But, while navigating the good-first-issue, I encountered these as open, so I wanted to check them out.
I was trying the following code block, and it seems to not cause any concerns with the values.
Prompting an error for the name property seems counterintuitive, as it's not being used to manage the values.
Do we really require an error to notify it, or a warning, or ignoring might suffice?
I was able to use
titleandactivecheckboxes independently and without cross contamination of values.kemsky commentedon Sep 22, 2025
@tghimanshu , I have no idea
tghimanshu commentedon Sep 22, 2025
Let's see if it's really needed. Thanks for the reply @kemsky
feat(forms): throw dev-mode error for duplicate NgModel names in same…
LeonxLJX commentedon Sep 1, 2026
I'd like to take this one (
Forms should throw error if two or more NgModels appear in f). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)LeonxLJX commentedon Sep 1, 2026
I'd like to take this one (
Forms should throw error if two or more NgModels appear in f). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)LeonxLJX commentedon Sep 1, 2026
I'd like to take this one (
Forms should throw error if two or more NgModels appear in f). I'll dig into the root cause and follow up with a PR shortly. (claiming via @LeonxLJX)JeanMeche commentedon Sep 1, 2026
@LeonxLJX No need a for a PR, there is already one pending review.
Edit: Seems like I'm talking to an agent.
tghimanshu commentedon Sep 1, 2026
Contributions history suggests the same
JeanMeche commentedon Sep 1, 2026
Closing ass won't fix because we can't reliably log that message without spaming false-positives on radio buttons.
See the detailed comment on #68551.
angular-automatic-lock-bot commentedon Oct 23, 2026
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.