@@ -174,8 +174,8 @@ function createAlertController(options: DialogOptions & MDCAlertControlerOptions
174
174
options . view instanceof View
175
175
? options . view
176
176
: Builder . createViewFromEntry ( {
177
- moduleName : options . view as string
178
- } ) ;
177
+ moduleName : options . view as string
178
+ } ) ;
179
179
180
180
view . cssClasses . add ( CSSUtils . MODAL_ROOT_VIEW_CSS_CLASS ) ;
181
181
const modalRootViewCssClasses = CSSUtils . getSystemCssClasses ( ) ;
@@ -246,17 +246,20 @@ export class AlertDialog {
246
246
alertController : MDCAlertController ;
247
247
presentingController : UIViewController ;
248
248
constructor ( private options : any ) { }
249
- show ( resolve ?) {
249
+
250
+ show ( onClosed ?) {
250
251
if ( ! this . alertController ) {
251
- this . alertController = createAlertController ( this . options , resolve ) ;
252
+ this . alertController = createAlertController ( this . options , onClosed ) ;
252
253
this . presentingController = showUIAlertController ( this . alertController , this . options ) ;
253
254
}
254
255
}
255
- hide ( ) {
256
+ async hide ( ) {
256
257
if ( this . presentingController ) {
257
- this . presentingController . dismissViewControllerAnimatedCompletion ( true , null ) ;
258
- this . presentingController = null ;
259
- this . alertController = null ;
258
+ return new Promise < void > ( ( resolve ) => {
259
+ this . presentingController . dismissViewControllerAnimatedCompletion ( true , resolve ) ;
260
+ this . presentingController = null ;
261
+ this . alertController = null ;
262
+ } ) ;
260
263
}
261
264
}
262
265
}
@@ -271,8 +274,8 @@ export function confirm(arg: any): Promise<boolean> {
271
274
} ;
272
275
const options = ! isDialogOptions ( arg )
273
276
? Object . assign ( defaultOptions , {
274
- message : arg + ''
275
- } )
277
+ message : arg + ''
278
+ } )
276
279
: Object . assign ( defaultOptions , arg ) ;
277
280
const alertController = createAlertController ( options , resolve ) ;
278
281
0 commit comments