Files
2016-01-19 16:44:46 +08:00

32 lines
530 B
TypeScript

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