feat(button): add color input

Closes #742
This commit is contained in:
Adam Bradley
2015-12-18 12:31:32 -06:00
parent 80b2579609
commit 9596142a4f
3 changed files with 47 additions and 13 deletions

View File

@@ -7,5 +7,15 @@ import {App, IonicApp} from 'ionic/ionic';
class E2EApp {
constructor(app: IonicApp) {
app.setTitle('Basic Buttons');
this.testingColors = ['primary', 'secondary', 'danger', 'dark'];
this.testingColorIndex = 0;
this.chgColor();
}
chgColor() {
this.btnColor = this.testingColors[this.testingColorIndex];
console.log('dynamic btnColor', this.btnColor);
this.testingColorIndex = (this.testingColorIndex >= this.testingColors.length - 1 ? 0 : this.testingColorIndex + 1);
}
}

View File

@@ -39,4 +39,9 @@
<button disabled>Disabled</button>
</p>
<p>
<button [color]="btnColor" (click)="chgColor()">Change Color</button>
<button outline [color]="btnColor" (click)="chgColor()">Change Color</button>
</p>
</ion-content>