Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Message for missing [ngModelOptions]="{standalone: true}" entry dont show line in code where it is missing #55674

Open
benjaminmilcic opened this issue May 4, 2024 · 0 comments

Comments

@benjaminmilcic
Copy link

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

No

Description

When using ngModel i get sometimes the error message:

ERROR Error: NG01352: If ngModel is used within a form tag, either the name attribute must be set or the form
control must be defined as 'standalone' in ngModelOptions.

Example 1: <input [(ngModel)]="person.firstName" name="first">
Example 2: <input [(ngModel)]="person.firstName" [ngModelOptions]="{standalone: true}">
at missingNameException (forms.mjs:3748:12)
at NgModel._checkName (forms.mjs:4070:19)
at NgModel._checkForErrors (forms.mjs:4053:14)
at NgModel.ngOnChanges (forms.mjs:3980:14)
at NgModel.rememberChangeHistoryAndInvokeOnChangesHook (core.mjs:4101:14)
at callHookInternal (core.mjs:5136:14)
at callHook (core.mjs:5167:9)
at callHooks (core.mjs:5118:17)
at executeInitAndCheckHooks (core.mjs:5068:9)
at refreshView (core.mjs:12806:21)

In the error message is not written, on which part of the code (i.e. in which file and which line of code) the error occurs.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

The error message should display in which file and which line of code the error occurs.

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 17.3.3
Node: 20.11.0
Package Manager: npm 10.2.4
OS: win32 x64

Angular: 17.3.3
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, material-luxon-adapter, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.3
@angular-devkit/build-angular   17.3.3
@angular-devkit/core            17.3.3
@angular-devkit/schematics      17.3.3
@angular/flex-layout            15.0.0-beta.42
@schematics/angular             17.3.3
rxjs                            7.8.1
typescript                      5.4.4
zone.js                         0.14.4

Anything else?

No response

@JeanMeche JeanMeche closed this as not planned Won't fix, can't repro, duplicate, stale May 4, 2024
@JeanMeche JeanMeche reopened this May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants