diff --git a/ionic/components/checkbox/checkbox.ts b/ionic/components/checkbox/checkbox.ts
index f662670e81..9f8adcf42d 100644
--- a/ionic/components/checkbox/checkbox.ts
+++ b/ionic/components/checkbox/checkbox.ts
@@ -32,7 +32,7 @@ import {Form} from '../../util/form';
],
host: {
'role': 'checkbox',
- 'tappable': 'true',
+ 'tappable': '',
'class': 'item',
'tabindex': 0,
'[attr.aria-disabled]': 'disabled'
@@ -60,7 +60,6 @@ export class Checkbox {
this.onChange = (_) => {};
this.onTouched = (_) => {};
- this.ngControl = ngControl;
if (ngControl) {
ngControl.valueAccessor = this;
}
@@ -85,7 +84,6 @@ export class Checkbox {
*/
toggle() {
this.checked = !this.checked;
- this.onChange(this.checked);
}
get checked() {
@@ -93,8 +91,9 @@ export class Checkbox {
}
set checked(val) {
- this._checked = val;
- this._renderer.setElementAttribute(this._elementRef, 'aria-checked', !!val);
+ this._checked = !!val;
+ this._renderer.setElementAttribute(this._elementRef, 'aria-checked', this._checked);
+ this.onChange(this._checked);
}
/**
diff --git a/ionic/components/toggle/toggle.ts b/ionic/components/toggle/toggle.ts
index 62f892a394..54dcc8d725 100644
--- a/ionic/components/toggle/toggle.ts
+++ b/ionic/components/toggle/toggle.ts
@@ -1,4 +1,4 @@
-import {Component, Directive, ElementRef, Host, Optional, Inject, forwardRef} from 'angular2/core';
+import {Component, ElementRef, Renderer, HostListener, Optional} from 'angular2/core';
import {NgControl} from 'angular2/common';
import {Form} from '../../util/form';
@@ -6,33 +6,6 @@ import {Config} from '../../config/config';
import {pointerCoord} from '../../util/dom';
-/**
- * @private
- */
-@Directive({
- selector: '.toggle-media',
- host: {
- '[class.toggle-activated]': 'toggle.isActivated'
- }
-})
-class MediaToggle {
- /**
- * TODO
- * @param {Toggle} toggle TODO
- * @param {} elementRef TODO
- * @param {Config} config TODO
- */
- constructor(
- @Host() @Inject(forwardRef(() => Toggle)) toggle: Toggle,
- elementRef: ElementRef
- ) {
- toggle.toggleEle = elementRef.nativeElement;
- this.toggle = toggle;
- }
-
-}
-
-
/**
* @name Toggle
* @description
@@ -81,17 +54,14 @@ class MediaToggle {
],
host: {
'role': 'checkbox',
- 'tappable': 'true',
- '[attr.id]': 'id',
- '[tabindex]': 'tabIndex',
- '[attr.aria-checked]': 'checked',
+ 'tappable': '',
+ 'class': 'item',
+ 'tabindex': 0,
'[attr.aria-disabled]': 'disabled',
- '[attr.aria-labelledby]': 'labelId',
'(touchstart)': 'pointerDown($event)',
'(mousedown)': 'pointerDown($event)',
'(touchend)': 'pointerUp($event)',
- '(mouseup)': 'pointerUp($event)',
- 'class': 'item'
+ '(mouseup)': 'pointerUp($event)'
},
template:
'