NgForm

NgForm

Stable Directive

What it does

Creates a top-level FormGroup instance and binds it to a form to track aggregate form value and validation status.

How to use

As soon as you import the FormsModule, this directive becomes active by default on all <form> tags. You don't need to add a special selector.

You can export the directive into a local template variable using ngForm as the key (ex: #myForm="ngForm"). This is optional, but useful. Many properties from the underlying 登录查看完整内容