Answers for "for dropdown getting this error 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."

5

ERROR Error: 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.

<!--Add the 'name' attribute-->
<input [(ngModel)]="note" name="something">

<!--Or-->
<input [(ngModel)]="note" [ngModelOptions]="{standalone: true}">
Posted by: Guest on May-07-2021

Code answers related to "for dropdown getting this error 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."

Browse Popular Code Answers by Language