@@ -174,8 +174,8 @@ function createAlertController(options: DialogOptions & MDCAlertControlerOptions
174174 options . view instanceof View
175175 ? options . view
176176 : Builder . createViewFromEntry ( {
177- moduleName : options . view as string
178- } ) ;
177+ moduleName : options . view as string
178+ } ) ;
179179
180180 view . cssClasses . add ( CSSUtils . MODAL_ROOT_VIEW_CSS_CLASS ) ;
181181 const modalRootViewCssClasses = CSSUtils . getSystemCssClasses ( ) ;
@@ -246,17 +246,20 @@ export class AlertDialog {
246246 alertController : MDCAlertController ;
247247 presentingController : UIViewController ;
248248 constructor ( private options : any ) { }
249- show ( resolve ?) {
249+
250+ show ( onClosed ?) {
250251 if ( ! this . alertController ) {
251- this . alertController = createAlertController ( this . options , resolve ) ;
252+ this . alertController = createAlertController ( this . options , onClosed ) ;
252253 this . presentingController = showUIAlertController ( this . alertController , this . options ) ;
253254 }
254255 }
255- hide ( ) {
256+ async hide ( ) {
256257 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+ } ) ;
260263 }
261264 }
262265}
@@ -271,8 +274,8 @@ export function confirm(arg: any): Promise<boolean> {
271274 } ;
272275 const options = ! isDialogOptions ( arg )
273276 ? Object . assign ( defaultOptions , {
274- message : arg + ''
275- } )
277+ message : arg + ''
278+ } )
276279 : Object . assign ( defaultOptions , arg ) ;
277280 const alertController = createAlertController ( options , resolve ) ;
278281
0 commit comments