export directive NgForm
export directive NgForm
exported from angular2/common defined in angular2/src/common/forms/directives/ng_form.ts (line 19)
If NgForm
is bound in a component, <form>
elements in that component will be
upgraded to use the Angular form system.
Typical Use
Include FORM_DIRECTIVES
in the directives
section of a View
annotation
to use NgForm
and its associated controls.
Structure
An Angular form is a collection of Control
s in some hierarchy.
Control
s can be at the top level or can be organized in ControlGroup
s
or ControlArray
s. This hierarchy is reflected in the form's value
, a
JSON object that mirrors the form structure.
Submission
The ngSubmit
event signals when the user triggers a form submission.
Example (live demo)
Selectors
form:not([ngNoForm]):not([ngFormModel])
ngForm
[ngForm]
Outputs
ng-submit
bound to NgForm.ngSubmit
Exported As
ngForm
Constructor
constructor(validators: any[], asyncValidators: any[])
constructor(validators: any[], asyncValidators: any[])
Not Yet Documented
Members
form : ControlGroup
form : ControlGroup
Not Yet Documented
ngSubmit : EventEmitter
ngSubmit : EventEmitter
Not Yet Documented
formDirective : Form
formDirective : Form
Not Yet Documented
control : ControlGroup
control : ControlGroup
Not Yet Documented
path : string[]
path : string[]
Not Yet Documented
controls : {[key: string]: AbstractControl}
controls : {[key: string]: AbstractControl}
Not Yet Documented
addControl(dir: NgControl) : void
addControl(dir: NgControl) : void
Not Yet Documented
getControl(dir: NgControl) : Control
getControl(dir: NgControl) : Control
Not Yet Documented
removeControl(dir: NgControl) : void
removeControl(dir: NgControl) : void
Not Yet Documented
addControlGroup(dir: NgControlGroup) : void
addControlGroup(dir: NgControlGroup) : void
Not Yet Documented
removeControlGroup(dir: NgControlGroup) : void
removeControlGroup(dir: NgControlGroup) : void
Not Yet Documented
getControlGroup(dir: NgControlGroup) : ControlGroup
getControlGroup(dir: NgControlGroup) : ControlGroup
Not Yet Documented
updateModel(dir: NgControl, value: any) : void
updateModel(dir: NgControl, value: any) : void
Not Yet Documented
onSubmit() : boolean
onSubmit() : boolean
Not Yet Documented