DEV Community

Cover image for If ngModel is used within a form tag, either the name attribute must be set or the form control must be defined as 'standalone'
Phinehas Alabi
Phinehas Alabi

Posted on

If ngModel is used within a form tag, either the name attribute must be set or the form control must be defined as 'standalone'

This happens when you are missing name attribute

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

Top comments (0)