Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Forms should throw error if two or more NgModels appear in form with the same name #13993

Copy link
Copy link
@kemsky

Description

@kemsky
Issue body actions

[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Currently there is no error or warning if two form controls have the same name:

<input name="entireStateCoverage" type="checkbox" [(ngModel)]="item.entireStateCoverage">
<input name="entireStateCoverage" type="checkbox" [(ngModel)]="item.active">

Expected behavior

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]

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: formsfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under considerationfreq1: lowgood first issueLabel noting a good first issue to be worked on by a community memberLabel noting a good first issue to be worked on by a community memberstate: has PR

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.