
p.location-badge.
  exported from <a href='../core'>angular2/core</a>
  defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/directives/default_value_accessor.ts#L8-L71">angular2/src/core/forms/directives/default_value_accessor.ts (line 8)</a>

:markdown
  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.
  
   # Example
   ```
   <input type="text" [(ng-model)]="searchQuery">
   ```
  
  

.l-main-section
  h2 Annotations
  .l-sub-section
    h3.annotation Directive
    pre.prettyprint
      code.
        @Directive({
          selector:
              &#39;input:not([type=checkbox])[ng-control],textarea[ng-control],input:not([type=checkbox])[ng-form-control],textarea[ng-form-control],input:not([type=checkbox])[ng-model],textarea[ng-model]&#39;,
          host: {
            &#39;(change)&#39;: &#39;onChange($event.target.value)&#39;,
            &#39;(input)&#39;: &#39;onChange($event.target.value)&#39;,
            &#39;(blur)&#39;: &#39;onTouched()&#39;,
            &#39;[class.ng-untouched]&#39;: &#39;ngClassUntouched&#39;,
            &#39;[class.ng-touched]&#39;: &#39;ngClassTouched&#39;,
            &#39;[class.ng-pristine]&#39;: &#39;ngClassPristine&#39;,
            &#39;[class.ng-dirty]&#39;: &#39;ngClassDirty&#39;,
            &#39;[class.ng-valid]&#39;: &#39;ngClassValid&#39;,
            &#39;[class.ng-invalid]&#39;: &#39;ngClassInvalid&#39;
          }
        })


.l-main-section
  h2 Members
  .l-sub-section
    h3#constructor constructor

    
    pre.prettyprint
      code.
        constructor(cd: NgControl, _renderer: Renderer, _elementRef: ElementRef)
    
    :markdown




  .l-sub-section
    h3#onChange onChange

    
    :markdown





  .l-sub-section
    h3#onTouched onTouched

    
    :markdown





  .l-sub-section
    h3#writeValue writeValue

    
    pre.prettyprint
      code.
        writeValue(value: any)
    
    :markdown





  .l-sub-section
    h3#ngClassUntouched ngClassUntouched

    
    :markdown





  .l-sub-section
    h3#ngClassTouched ngClassTouched

    
    :markdown





  .l-sub-section
    h3#ngClassPristine ngClassPristine

    
    :markdown





  .l-sub-section
    h3#ngClassDirty ngClassDirty

    
    :markdown





  .l-sub-section
    h3#ngClassValid ngClassValid

    
    :markdown





  .l-sub-section
    h3#ngClassInvalid ngClassInvalid

    
    :markdown





  .l-sub-section
    h3#registerOnChange registerOnChange

    
    pre.prettyprint
      code.
        registerOnChange(fn: (_: any) =&gt; void)
    
    :markdown





  .l-sub-section
    h3#registerOnTouched registerOnTouched

    
    pre.prettyprint
      code.
        registerOnTouched(fn: () =&gt; void)
    
    :markdown




