working modals

This commit is contained in:
Adam Bradley
2015-10-05 11:05:51 -05:00
parent 7a4f2ea3b1
commit cd319e1cf2
8 changed files with 49 additions and 52 deletions

View File

@@ -3,6 +3,7 @@ import {Injectable} from 'angular2/angular2';
import {OverlayController} from '../overlay/overlay-controller';
import {IonicConfig} from '../../config/config';
import {Animation} from '../../animations/animation';
import {makeComponent} from '../../config/decorators';
import * as util from 'ionic/util';
/**
@@ -46,9 +47,11 @@ export class Modal {
* @returns {TODO} TODO
*/
open(componentType: Type, opts={}) {
let modalComponent = makeComponent(componentType, {
selector: 'ion-modal'
});
return this.ctrl.open(OVERLAY_TYPE, componentType, util.extend(this._defaults, opts));
return this.ctrl.open(OVERLAY_TYPE, modalComponent, util.extend(this._defaults, opts));
}
/**

View File

@@ -24,8 +24,6 @@ class MyAppCmp {
console.log('android', platform.is('android'))
console.log('windows phone', platform.is('windowsphone'))
console.log('isRTL', app.isRTL())
platform.ready().then(() => {
console.log('platform.ready')
});
@@ -33,14 +31,15 @@ class MyAppCmp {
}
openModal() {
this.modal.open(ContactModal);
this.modal.open(ContactModal, {
handle: 'my-awesome-modal'
});
}
openModalCustomAnimation() {
this.modal.open(ContactModal, {
enterAnimation: 'my-fade-in',
leaveAnimation: 'my-fade-out',
handle: 'my-awesome-modal'
leaveAnimation: 'my-fade-out'
});
}
}