diff --git a/ionic/components/checkbox/checkbox.ts b/ionic/components/checkbox/checkbox.ts index 8f796e1de6..a80f54cde9 100644 --- a/ionic/components/checkbox/checkbox.ts +++ b/ionic/components/checkbox/checkbox.ts @@ -81,11 +81,11 @@ export class Checkbox { this.checked = !this.checked; } + @Input() get checked() { return !!this._checked; } - @Input() set checked(val) { this._checked = !!val; this._renderer.setElementAttribute(this._elementRef, 'aria-checked', this._checked.toString()); diff --git a/ionic/components/icon/icon.ts b/ionic/components/icon/icon.ts index 6401d3abc8..392a321637 100644 --- a/ionic/components/icon/icon.ts +++ b/ionic/components/icon/icon.ts @@ -70,12 +70,12 @@ export class Icon { } } - get name(): string { + @Input() + get name() { return this._name; } - - @Input() - set name(val: string) { + + set name(val) { if (!(/^md-|^ios-|^logo-/.test(val))) { // this does not have one of the defaults // so lets auto add in the mode prefix for them @@ -85,31 +85,31 @@ export class Icon { this.update(); } + @Input() get ios(): string { return this._ios; } - @Input() set ios(val: string) { this._ios = val; this.update(); } + @Input() get md(): string { return this._md; } - @Input() set md(val: string) { this._md = val; this.update(); } + @Input() get isActive() { return (this._isActive === undefined || this._isActive === true || this._isActive === 'true'); } - @Input() set isActive(val) { this._isActive = val; this.update(); diff --git a/ionic/components/option/option.ts b/ionic/components/option/option.ts index e14b3a3cf2..14c59f3199 100644 --- a/ionic/components/option/option.ts +++ b/ionic/components/option/option.ts @@ -10,17 +10,17 @@ import {Directive, ElementRef, Input} from 'angular2/core'; export class Option { private _checked: boolean = false; + @Input() value: string; + constructor(private _elementRef: ElementRef) { this._checked = false; } - @Input() value: string; - + @Input() get checked() { return this._checked; } - @Input() set checked(val: any) { this._checked = (val === 'true' || val === true || val === ''); } diff --git a/ionic/components/toggle/toggle.ts b/ionic/components/toggle/toggle.ts index 309d1c696e..43c2ef21d3 100644 --- a/ionic/components/toggle/toggle.ts +++ b/ionic/components/toggle/toggle.ts @@ -157,11 +157,11 @@ export class Toggle { this.checked = !this.checked; } + @Input() get checked(): boolean { return !!this._checked; } - @Input() set checked(val: boolean) { this._checked = !!val; this._renderer.setElementAttribute(this._elementRef, 'aria-checked', this._checked.toString());