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/select_control_value_accessor.ts#L24-L82">angular2/src/forms/directives/select_control_value_accessor.ts (line 24)</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: 'select[ng-control],select[ng-form-control],select[ng-model]',
host: {
'(change)': 'onChange($event.target.value)',
'(input)': 'onChange($event.target.value)',
'(blur)': 'onTouched()',
'[class.ng-untouched]': 'ngClassUntouched',
'[class.ng-touched]': 'ngClassTouched',
'[class.ng-pristine]': 'ngClassPristine',
'[class.ng-dirty]': 'ngClassDirty',
'[class.ng-valid]': 'ngClassValid',
'[class.ng-invalid]': 'ngClassInvalid'
}
})
2015-07-28 01:12:30 -04:00
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(cd: NgControl, renderer: Renderer, elementRef: ElementRef, query: QueryList<NgSelectOption>)
:markdown
.l-sub-section
2015-07-28 16:28:47 -04:00
h3 cd
2015-07-28 01:12:30 -04:00
:markdown
.l-sub-section
2015-07-28 16:28:47 -04:00
h3 value
2015-07-28 01:12:30 -04:00
:markdown
.l-sub-section
2015-07-28 16:28:47 -04:00
h3 onChange
2015-07-28 01:12:30 -04:00
:markdown
.l-sub-section
2015-07-28 16:28:47 -04:00
h3 onTouched
2015-07-28 01:12:30 -04:00
:markdown
.l-sub-section
h3 renderer
:markdown
.l-sub-section
h3 elementRef
:markdown
.l-sub-section
h3 writeValue
pre.prettyprint
code.
writeValue(value: any)
:markdown
.l-sub-section
h3 ngClassUntouched
:markdown
.l-sub-section
h3 ngClassTouched
:markdown
.l-sub-section
h3 ngClassPristine
:markdown
.l-sub-section
h3 ngClassDirty
:markdown
.l-sub-section
h3 ngClassValid
:markdown
.l-sub-section
h3 ngClassInvalid
:markdown
.l-sub-section
h3 registerOnChange
pre.prettyprint
code.
registerOnChange(fn: () => any)
:markdown
.l-sub-section
h3 registerOnTouched
pre.prettyprint
code.
registerOnTouched(fn: () => any)
:markdown