Files
2016-01-08 16:26:07 -06:00

28 lines
510 B
TypeScript

import {Directive, ElementRef, Input} from 'angular2/core';
/**
* @name Option
*/
@Directive({
selector: 'ion-option'
})
export class Option {
constructor(private _elementRef: ElementRef) {
this._checked = false;
}
@Input() value: string;
get checked(): boolean {
return this._checked;
}
@Input() checked;
set checked(val:string) {
this._checked = (val === 'true' || val === true || val === '');
}
get text() {
return this._elementRef.nativeElement.textContent;
}
}