mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
working modals
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user