NgModelGrouplink
Creates and binds a FormGroup
instance to a DOM element.
选择器
输入参数
导出为
说明
This directive can only be used as a child of NgForm
(or in other words, within <form>
tags).
Use this directive if you'd like to create a sub-group within a form. This can come in handy if you want to validate a sub-group of your form separately from the rest of your form, or if some values in your domain model make more sense to consume together in a nested object.
Pass in the name you'd like this sub-group to have and it will become the key for the sub-group in the form's full value. You can also export the directive into a local template variable using ngModelGroup
(ex: #myGroup="ngModelGroup"
).
npm package:
@angular/forms
NgModule:
FormsModule
属性
属性名 | 类型 | 说明 |
---|---|---|
name |