File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export const AppRootToken = new OpaqueToken('USERROOT');
15
15
selector : 'ion-app' ,
16
16
template :
17
17
'<div #viewport app-viewport></div>' +
18
+ '<div #modalPortal overlay-portal></div>' +
18
19
'<div #overlayPortal overlay-portal></div>' +
19
20
'<div #loadingPortal class="loading-portal" overlay-portal></div>' +
20
21
'<div #toastPortal class="toast-portal" overlay-portal></div>' +
@@ -24,6 +25,8 @@ export class IonicApp extends Ion implements OnInit {
24
25
25
26
@ViewChild ( 'viewport' , { read : ViewContainerRef } ) _viewport : ViewContainerRef ;
26
27
28
+ @ViewChild ( 'modalPortal' , { read : OverlayPortal } ) _modalPortal : OverlayPortal ;
29
+
27
30
@ViewChild ( 'overlayPortal' , { read : OverlayPortal } ) _overlayPortal : OverlayPortal ;
28
31
29
32
@ViewChild ( 'loadingPortal' , { read : OverlayPortal } ) _loadingPortal : OverlayPortal ;
@@ -96,6 +99,9 @@ export class IonicApp extends Ion implements OnInit {
96
99
if ( portal === AppPortal . TOAST ) {
97
100
return this . _toastPortal ;
98
101
}
102
+ if ( portal === AppPortal . MODAL ) {
103
+ return this . _modalPortal ;
104
+ }
99
105
return this . _overlayPortal ;
100
106
}
101
107
@@ -110,6 +116,7 @@ export class IonicApp extends Ion implements OnInit {
110
116
111
117
export enum AppPortal {
112
118
DEFAULT ,
119
+ MODAL ,
113
120
LOADING ,
114
121
TOAST
115
122
} ;
Original file line number Diff line number Diff line change 1
1
import { Injectable } from '@angular/core' ;
2
2
3
3
import { App } from '../app/app' ;
4
+ import { AppPortal } from '../app/app-root' ;
4
5
import { isPresent } from '../../util/util' ;
5
6
import { ModalCmp } from './modal-component' ;
6
7
import { ModalOptions } from './modal-options' ;
@@ -40,7 +41,7 @@ export class Modal extends ViewController {
40
41
* @returns {Promise } Returns a promise which is resolved when the transition has completed.
41
42
*/
42
43
present ( navOptions : NavOptions = { } ) {
43
- return this . _app . present ( this , navOptions ) ;
44
+ return this . _app . present ( this , navOptions , AppPortal . MODAL ) ;
44
45
}
45
46
46
47
/**
You can’t perform that action at this time.
0 commit comments