Answers for "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."

1

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.

// If form is used, all the input fields which have [(ngModel)]="" must have 
// an attribute name with a value.

<input [(ngModel)]="firstname" name="something">
Posted by: Guest on March-03-2021
0

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 2: <input [(ngModel)]="person.myfirstName" [ngModelOptions]="{standalone: true}">
Posted by: Guest on September-02-2020

Code answers related to "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."

Code answers related to "Javascript"

Browse Popular Code Answers by Language