mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 21:48:42 +08:00
fix(Input): put @Input above getters
This commit is contained in:
@ -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());
|
||||
|
@ -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();
|
||||
|
@ -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 === '');
|
||||
}
|
||||
|
@ -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());
|
||||
|
Reference in New Issue
Block a user