W3cubDocs

/Angular 4 TypeScript

CheckboxControlValueAccessor

Stable Directive

Class Overview

class CheckboxControlValueAccessor implements ControlValueAccessor {
  constructor(_renderer: Renderer, _elementRef: ElementRef)
  
  
  onChange : (_: any) => {}
  onTouched : () => {}
  writeValue(value: any) : void
  registerOnChange(fn: (_: any) => {}) : void
  registerOnTouched(fn: () => {}) : void
  setDisabledState(isDisabled: boolean) : void
}

Selectors

input[type=checkbox][formControlName]

input[type=checkbox][formControl]

input[type=checkbox][ngModel]

Class Description

The accessor for writing a value and listening to changes on a checkbox input element.

Example

<input type="checkbox" name="rememberLogin" ngModel>

Constructor

constructor(_renderer: Renderer, _elementRef: ElementRef)

Class Details

onChange : (_: any) => {}
onTouched : () => {}
writeValue(value: any) : void
registerOnChange(fn: (_: any) => {}) : void
registerOnTouched(fn: () => {}) : void
setDisabledState(isDisabled: boolean) : void

exported from forms/index, defined in forms/src/directives/checkbox_value_accessor.ts

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/docs/ts/latest/api/forms/index/CheckboxControlValueAccessor-directive.html