mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
chore(): add types to Option
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
import {Directive, ElementRef, Input} from 'angular2/core';
|
import {Directive, ElementRef, Input} from 'angular2/core';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Option
|
* @name Option
|
||||||
*/
|
*/
|
||||||
@ -7,17 +8,20 @@ import {Directive, ElementRef, Input} from 'angular2/core';
|
|||||||
selector: 'ion-option'
|
selector: 'ion-option'
|
||||||
})
|
})
|
||||||
export class Option {
|
export class Option {
|
||||||
|
private _checked: boolean = false;
|
||||||
|
|
||||||
constructor(private _elementRef: ElementRef) {
|
constructor(private _elementRef: ElementRef) {
|
||||||
this._checked = false;
|
this._checked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Input() value: string;
|
@Input() value: string;
|
||||||
|
|
||||||
get checked(): boolean {
|
get checked() {
|
||||||
return this._checked;
|
return this._checked;
|
||||||
}
|
}
|
||||||
@Input() checked;
|
|
||||||
set checked(val:string) {
|
@Input()
|
||||||
|
set checked(val: any) {
|
||||||
this._checked = (val === 'true' || val === true || val === '');
|
this._checked = (val === 'true' || val === true || val === '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user