ngModel cannot be used to register form controls with a parent formGroup directive

前端 未结 10 2059
猫巷女王i
猫巷女王i 2020-12-04 17:21

After upgrading to RC5 we began getting this error:

ngModel cannot be used to register form controls with a parent formGroup 
 directive.
Try using formGroup\         


        
10条回答
  •  误落风尘
    2020-12-04 17:59

    The answer is right on the error message, you need to indicate that it's standalone and therefore it doesn't conflict with the form controls:

    [ngModelOptions]="{standalone: true}"
    

提交回复
热议问题