Added property class feature to IonicComponent

This commit is contained in:
Max Lynch
2015-04-24 11:03:01 -05:00
parent 969b1ae9cd
commit 32befad143
6 changed files with 76 additions and 10 deletions

View File

@ -2,7 +2,7 @@ import {NgElement, Decorator} from 'angular2/angular2'
import {IonicComponent} from 'ionic2/config/component'
@Decorator({
selector: '.button',
selector: 'ion-button, [ion-button],.button',
})
export class Button {
constructor(
@ -12,4 +12,6 @@ export class Button {
this.config = Button.config.invoke(this)
}
}
new IonicComponent(Button, {})
new IonicComponent(Button, {
propClasses: ['primary', 'secondary', 'danger', 'light', 'stable', 'dark']
})

View File

@ -47,3 +47,14 @@
<button class="button button-dark hover">hover</button>
<button class="button button-dark activated">activated</button>
</div>
<h2>With Properties</h2>
<div>
<button ion-button primary>button.primary</button>
<button ion-button secondary>button.secondary</button>
<button ion-button stable>button.stable</button>
<button ion-button light>button.light</button>
<button ion-button dark>button.dark</button>
<button ion-button danger>button.danger</button>
</div>