fix(Input): put @Input above getters

This commit is contained in:
Adam Bradley
2016-01-14 20:05:00 -06:00
parent c740b8e479
commit 1a3d8c8814
4 changed files with 12 additions and 12 deletions

View File

@ -81,11 +81,11 @@ export class Checkbox {
this.checked = !this.checked; this.checked = !this.checked;
} }
@Input()
get checked() { get checked() {
return !!this._checked; return !!this._checked;
} }
@Input()
set checked(val) { set checked(val) {
this._checked = !!val; this._checked = !!val;
this._renderer.setElementAttribute(this._elementRef, 'aria-checked', this._checked.toString()); this._renderer.setElementAttribute(this._elementRef, 'aria-checked', this._checked.toString());

View File

@ -70,12 +70,12 @@ export class Icon {
} }
} }
get name(): string { @Input()
get name() {
return this._name; return this._name;
} }
@Input() set name(val) {
set name(val: string) {
if (!(/^md-|^ios-|^logo-/.test(val))) { if (!(/^md-|^ios-|^logo-/.test(val))) {
// this does not have one of the defaults // this does not have one of the defaults
// so lets auto add in the mode prefix for them // so lets auto add in the mode prefix for them
@ -85,31 +85,31 @@ export class Icon {
this.update(); this.update();
} }
@Input()
get ios(): string { get ios(): string {
return this._ios; return this._ios;
} }
@Input()
set ios(val: string) { set ios(val: string) {
this._ios = val; this._ios = val;
this.update(); this.update();
} }
@Input()
get md(): string { get md(): string {
return this._md; return this._md;
} }
@Input()
set md(val: string) { set md(val: string) {
this._md = val; this._md = val;
this.update(); this.update();
} }
@Input()
get isActive() { get isActive() {
return (this._isActive === undefined || this._isActive === true || this._isActive === 'true'); return (this._isActive === undefined || this._isActive === true || this._isActive === 'true');
} }
@Input()
set isActive(val) { set isActive(val) {
this._isActive = val; this._isActive = val;
this.update(); this.update();

View File

@ -10,17 +10,17 @@ import {Directive, ElementRef, Input} from 'angular2/core';
export class Option { export class Option {
private _checked: boolean = false; private _checked: boolean = false;
@Input() value: string;
constructor(private _elementRef: ElementRef) { constructor(private _elementRef: ElementRef) {
this._checked = false; this._checked = false;
} }
@Input() value: string; @Input()
get checked() { get checked() {
return this._checked; return this._checked;
} }
@Input()
set checked(val: any) { set checked(val: any) {
this._checked = (val === 'true' || val === true || val === ''); this._checked = (val === 'true' || val === true || val === '');
} }

View File

@ -157,11 +157,11 @@ export class Toggle {
this.checked = !this.checked; this.checked = !this.checked;
} }
@Input()
get checked(): boolean { get checked(): boolean {
return !!this._checked; return !!this._checked;
} }
@Input()
set checked(val: boolean) { set checked(val: boolean) {
this._checked = !!val; this._checked = !!val;
this._renderer.setElementAttribute(this._elementRef, 'aria-checked', this._checked.toString()); this._renderer.setElementAttribute(this._elementRef, 'aria-checked', this._checked.toString());