From b4e66c3f6f6dcddd19d375b85ede6db0a5472879 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Mon, 4 May 2015 13:27:39 -0500 Subject: [PATCH] Support raw element enhancement --- ionic/components/button/button.js | 3 ++- ionic/components/button/test/basic/main.html | 12 +++++----- ionic/config/component.js | 23 ++++++++++++++++---- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/ionic/components/button/button.js b/ionic/components/button/button.js index ec7f11af40..35ac9364fa 100644 --- a/ionic/components/button/button.js +++ b/ionic/components/button/button.js @@ -2,7 +2,7 @@ import {NgElement, Decorator} from 'angular2/angular2' import {IonicComponent} from 'ionic/config/component' @Decorator({ - selector: 'ion-button, [ion-button],.button', + selector: 'button, ion-button, [ion-button],.button', }) export class Button { constructor( @@ -13,5 +13,6 @@ export class Button { } } new IonicComponent(Button, { + enhanceRawElement: true, propClasses: ['primary', 'secondary', 'danger', 'light', 'stable', 'dark', 'block'] }) diff --git a/ionic/components/button/test/basic/main.html b/ionic/components/button/test/basic/main.html index ea03bcaae2..fb511e1987 100644 --- a/ionic/components/button/test/basic/main.html +++ b/ionic/components/button/test/basic/main.html @@ -51,10 +51,10 @@

With Properties

- - - - - - + + + + + +
diff --git a/ionic/config/component.js b/ionic/config/component.js index b5b188896b..13184a3468 100644 --- a/ionic/config/component.js +++ b/ionic/config/component.js @@ -11,6 +11,7 @@ let platformMode = Platform.getMode(); export class IonicComponent { constructor(ComponentClass, { bind, + enhanceRawElement, delegates, propClasses }) { @@ -31,6 +32,11 @@ export class IonicComponent { this.delegates = delegates || (delegates = {}) this.propClasses = propClasses || (propClasses = []); + + // Whether to support raw element enhancement (for example, supporting