import { Directive , ElementRef , EventEmitter , Input , Output } from '@angular/core' ; import { isPresent , isTrueProperty } from '../../util/util' ; name description demo @ Directive ( { selector : 'ion-option' } ) export class Option { _selected : boolean = false ; _disabled : boolean = false ; _value : any ; input @ Input ( ) get disabled ( ) : boolean { return this . _disabled ; } set disabled ( val ) { this . _disabled = isTrueProperty ( val ) ; } input @ Input ( ) get selected ( ) : boolean { return this . _selected ; } set selected ( val ) { this . _selected = isTrueProperty ( val ) ; } input @ Input ( ) get value ( ) { if ( isPresent ( this . _value ) ) { return this . _value ; } return this . text ; } set value ( val ) { this . _value = val ; } output @ Output ( ) ionSelect : EventEmitter < any > = new EventEmitter ( ) ; constructor ( private _elementRef ) { } hidden get text ( ) { return this . _elementRef . nativeElement . textContent ; } }