angular2 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.

在使用ngmodel进行双向数据绑定的时候,必须设置 name 属性或者使用[ngModelOptions]="{standalone: true}",

否则页面就会报错: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.

你可能感兴趣的:(angular2 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.)