2015-04-19 13:53:18 -07:00
2015-04-22 08:06:51 -07:00
p.location-badge.
2015-06-01 22:51:00 -07:00
exported from <a href='../forms'>angular2/forms</a>
2015-06-19 12:08:22 -07:00
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/forms/directives/default_value_accessor.ts#L5-L55">angular2/src/forms/directives/default_value_accessor.ts (line 5)</a>
2015-04-19 13:53:18 -07:00
:markdown
2015-06-19 12:08:22 -07:00
The default accessor for writing a value and listening to changes that is used by the
<a href='NgModel-class.html'><code>NgModel</code></a>, <a href='NgFormControl-class.html'><code>NgFormControl</code></a>, and <a href='NgControlName-class.html'><code>NgControlName</code></a> directives.
2015-04-19 13:53:18 -07:00
# Example
```
2015-06-19 12:08:22 -07:00
<input type="text" [(ng-model)]="searchQuery">
2015-04-19 13:53:18 -07:00
```
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
2015-06-19 12:08:22 -07:00
constructor(cd: NgControl, renderer: Renderer, elementRef: ElementRef)
2015-04-19 13:53:18 -07:00
:markdown
2015-06-01 22:51:00 -07:00
2015-04-19 13:53:18 -07:00
2015-06-19 12:08:22 -07:00
.l-sub-section
h3 value
:markdown
2015-04-19 13:53:18 -07:00
.l-sub-section
h3 onChange
:markdown
2015-05-01 06:37:29 -07:00
2015-04-19 13:53:18 -07:00
2015-06-01 22:51:00 -07:00
.l-sub-section
2015-06-19 12:08:22 -07:00
h3 onTouched
2015-06-01 22:51:00 -07:00
2015-06-19 12:08:22 -07:00
:markdown
.l-sub-section
h3 cd
2015-06-01 22:51:00 -07:00
:markdown
2015-04-19 13:53:18 -07:00
2015-04-28 06:22:25 -07:00
.l-sub-section
2015-06-19 12:08:22 -07:00
h3 renderer
:markdown
.l-sub-section
h3 elementRef
2015-04-28 06:22:25 -07:00
:markdown
2015-05-01 06:37:29 -07:00
2015-04-28 06:22:25 -07:00
2015-06-01 22:51:00 -07:00
2015-04-28 06:22:25 -07:00
2015-04-19 13:53:18 -07:00
.l-sub-section
h3 writeValue
pre.prettyprint
code.
2015-04-20 13:57:43 -07:00
writeValue(value)
2015-04-19 13:53:18 -07:00
:markdown
2015-05-01 06:37:29 -07:00
2015-04-19 13:53:18 -07:00
2015-06-01 22:51:00 -07:00
2015-04-19 13:53:18 -07:00
2015-06-19 12:08:22 -07:00
.l-sub-section
h3 registerOnChange
pre.prettyprint
code.
registerOnChange(fn)
:markdown
.l-sub-section
h3 registerOnTouched
pre.prettyprint
code.
registerOnTouched(fn)
:markdown