diff --git a/ionic/components/action-menu/action-menu.js b/ionic/components/action-menu/action-menu.js index fc7422a044..0a341b5ea1 100644 --- a/ionic/components/action-menu/action-menu.js +++ b/ionic/components/action-menu/action-menu.js @@ -14,12 +14,12 @@ import {IonicRoot} from '../app/app'; import * as util from 'ionic/util'; import {Overlay} from '../overlay/overlay'; -import {IonicComponentNew} from '../../config/component'; +import {IonicComponentNEW} from '../../config/component'; import {Animation} from 'ionic/animations/animation'; import {ClickBlock} from '../../util/click-block'; -@IonicComponentNew(ActionMenu) +@IonicComponentNEW(ActionMenu) @View({ template: `
@@ -41,16 +41,13 @@ export class ActionMenu extends Overlay { constructor() { super(); - this.setOptions({ + this.extendOptions({ + destructiveButtonClicked: util.noop, + buttonClicked: util.noop, + cancel: util.noop, enterAnimation: 'action-menu-slide-in', leaveAnimation: 'action-menu-slide-out' }); - - this.options = { - destructiveButtonClicked: util.noop, - buttonClicked: util.noop, - cancel: util.noop - }; } cancel() { diff --git a/ionic/components/app/app.js b/ionic/components/app/app.js index 1e0482ab6b..f0c3875548 100644 --- a/ionic/components/app/app.js +++ b/ionic/components/app/app.js @@ -78,7 +78,7 @@ class IonicAppRoot { let loader = rootComponent.loader; let elementRef = rootComponent.anchorElementRef(); - return new Promise(resolve => { + return new Promise((resolve, reject) => { rootComponent.compiler.compileInHost(ComponentType).then(componentProtoViewRef => { let containerRef = rootComponent.anchorViewContainerRef(); @@ -92,6 +92,9 @@ class IonicAppRoot { }; resolve(hostViewRef); + }).catch(err => { + console.error('IonicAppRoot append:', err); + reject(err); }); }); } diff --git a/ionic/components/modal/modal.js b/ionic/components/modal/modal.js index 70ea29bf1c..fdef5888d3 100644 --- a/ionic/components/modal/modal.js +++ b/ionic/components/modal/modal.js @@ -6,7 +6,7 @@ export class Modal extends Overlay { constructor() { super(); - this.setOptions({ + this.extendOptions({ enterAnimation: 'modal-slide-in', leaveAnimation: 'modal-slide-out' }); diff --git a/ionic/components/overlay/overlay.js b/ionic/components/overlay/overlay.js index ef29521639..b30ecec395 100644 --- a/ionic/components/overlay/overlay.js +++ b/ionic/components/overlay/overlay.js @@ -8,7 +8,7 @@ export class Overlay { /* Instance Methods */ open(animation) { - animation = animation || this._opts.enterAnimation; + animation = animation || this.options.enterAnimation; let enterAnimation = Animation.create(this.domElement, animation); ClickBlock(true, enterAnimation.duration() + 200); @@ -23,7 +23,7 @@ export class Overlay { close(animation) { return new Promise(resolve => { - animation = animation || this._opts.leaveAnimation; + animation = animation || this.options.leaveAnimation; let leavingAnimation = Animation.create(this.domElement, animation); leavingAnimation.play().then(() => { @@ -34,9 +34,9 @@ export class Overlay { }); } - setOptions(opts) { - if (!this._opts) this._opts = {}; - util.extend(this._opts, opts); + extendOptions(opts) { + if (!this.options) this.options = {}; + util.extend(this.options, opts); } _clean() { @@ -46,14 +46,18 @@ export class Overlay { /* Static Methods */ static create(ComponentType: Type, opts) { - return new Promise(resolve => { + return new Promise((resolve, reject) => { IonicRoot.append(ComponentType).then((ref) => { let overlay = ref.instance; overlay._dispose = ref.dispose; overlay.domElement = ref.elementRef.domElement; - overlay.setOptions(opts); + overlay.extendOptions(opts); overlay.open(); resolve(overlay); + + }).catch(err => { + console.error('Overlay create:', err); + reject(err); }); }); } diff --git a/ionic/components/tabs/tabs.js b/ionic/components/tabs/tabs.js index fb6129fa94..3f2f8da5b3 100644 --- a/ionic/components/tabs/tabs.js +++ b/ionic/components/tabs/tabs.js @@ -11,23 +11,11 @@ import {ViewController} from '../view/view-controller'; import {ViewItem} from '../view/view-item'; import {TabButton} from './tab-button'; import {Icon} from '../icon/icon'; -import {IonicComponent} from '../../config/component'; -import {ModeComponent} from '../../config/component'; +import {IonicComponentNEW} from '../../config/component'; import {Config} from '../../config/component'; -@ModeComponent({ - selector: 'ion-tabs', - properties: [ - 'tabBarPlacement', - 'tabBarIcons' - ], - hostProperties: { - 'tabBarPlacement': 'attr.tab-bar-placement', - 'tabBarIcons': 'attr.tab-bar-icons' - }, - classId: 'tabs' -}) +@IonicComponentNEW(Tabs) @View({ template: `