2015-07-28 01:12:30 -04:00
p.location-badge.
exported from <a href='../forms'>angular2/forms</a>
2015-09-01 16:55:47 -04:00
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.36/modules/angular2/src/forms/directives/ng_form_model.ts#L15-L142">angular2/src/forms/directives/ng_form_model.ts (line 15)</a>
2015-07-28 01:12:30 -04:00
:markdown
2015-09-01 16:55:47 -04:00
This module is used for handling user input, by defining and building a <a href='ControlGroup-class.html'><code>ControlGroup</code></a> that
consists of
<a href='Control-class.html'><code>Control</code></a> objects, and mapping them onto the DOM. <a href='Control-class.html'><code>Control</code></a> objects can then be used
to read information
from the form DOM elements.
2015-07-28 01:12:30 -04:00
2015-09-01 16:55:47 -04:00
This module is not included in the `angular2` module; you must import the forms module
explicitly.
2015-07-28 16:28:47 -04:00
.l-main-section
h2 Annotations
.l-sub-section
h3.annotation Directive
pre.prettyprint
code.
@Directive({
selector: '[ng-form-model]',
2015-08-03 02:08:36 -04:00
bindings: [formDirectiveBinding],
2015-07-28 16:28:47 -04:00
properties: ['form: ng-form-model'],
2015-09-01 16:55:47 -04:00
lifecycle: [LifecycleEvent.OnChanges],
2015-07-28 16:28:47 -04:00
host: {
'(submit)': 'onSubmit()',
},
events: ['ngSubmit'],
exportAs: 'form'
})
2015-07-28 01:12:30 -04:00
.l-main-section
h2 Members
.l-sub-section
h3 form
:markdown
.l-sub-section
h3 directives
:markdown
.l-sub-section
h3 ngSubmit
:markdown
.l-sub-section
2015-09-01 16:55:47 -04:00
h3 onChanges
2015-07-28 01:12:30 -04:00
pre.prettyprint
code.
2015-09-01 16:55:47 -04:00
onChanges(_: any)
2015-07-28 01:12:30 -04:00
:markdown
.l-sub-section
h3 formDirective
:markdown
.l-sub-section
h3 control
:markdown
.l-sub-section
h3 path
:markdown
.l-sub-section
h3 addControl
pre.prettyprint
code.
addControl(dir: NgControl)
:markdown
.l-sub-section
h3 getControl
pre.prettyprint
code.
getControl(dir: NgControl)
:markdown
.l-sub-section
h3 removeControl
pre.prettyprint
code.
removeControl(dir: NgControl)
:markdown
.l-sub-section
h3 addControlGroup
pre.prettyprint
code.
addControlGroup(dir: NgControlGroup)
:markdown
.l-sub-section
h3 removeControlGroup
pre.prettyprint
code.
removeControlGroup(dir: NgControlGroup)
:markdown
.l-sub-section
h3 getControlGroup
pre.prettyprint
code.
getControlGroup(dir: NgControlGroup)
:markdown
.l-sub-section
h3 updateModel
pre.prettyprint
code.
updateModel(dir: NgControl, value: any)
:markdown
.l-sub-section
h3 onSubmit
pre.prettyprint
code.
onSubmit()
:markdown