From 89eaaa5d5e77152a9c452abe00e7f1294cbf4845 Mon Sep 17 00:00:00 2001 From: Mark Nadig Date: Wed, 23 Sep 2015 18:16:27 -0600 Subject: [PATCH] ng-dialog create IDialogClosePromise type to be returned by closePromise. --- ng-dialog/ng-dialog-tests.ts | 6 +++++- ng-dialog/ng-dialog.d.ts | 15 ++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ng-dialog/ng-dialog-tests.ts b/ng-dialog/ng-dialog-tests.ts index 52b33212aa..6d68111a6d 100644 --- a/ng-dialog/ng-dialog-tests.ts +++ b/ng-dialog/ng-dialog-tests.ts @@ -23,6 +23,10 @@ class DialogTestController { name: "login-popup" }); + loginDialog.closePromise.then((result) => { + var val: any = result.value; + }); + if (loginDialog.id === "login-popup") { loginDialog.close("closing"); } @@ -49,4 +53,4 @@ app.config((ngDialogProvider: angular.dialog.IDialogProvider) => { className: "flat-ui" }) -}); \ No newline at end of file +}); diff --git a/ng-dialog/ng-dialog.d.ts b/ng-dialog/ng-dialog.d.ts index 3f045a8e11..3ad5c4d09a 100644 --- a/ng-dialog/ng-dialog.d.ts +++ b/ng-dialog/ng-dialog.d.ts @@ -26,14 +26,19 @@ declare module angular.dialog { interface IDialogOpenResult { id: string; close: (value?: string) => void; - closePromise: IPromise; + closePromise: IPromise; + } + + interface IDialogClosePromise { + id: string; + value: any; } interface IDialogProvider extends angular.IServiceProvider { /** * Default options for the dialogs. - * @param defaultOptions - * @returns {} + * @param defaultOptions + * @returns {} */ setDefaults(defaultOptions: IDialogOptions): void; } @@ -44,7 +49,7 @@ declare module angular.dialog { interface IDialogScope extends angular.IScope { /** * This allows you to close dialog straight from handler in a popup element. - * @param value Any value passed to this function will be attached to the object which resolves on the close promise for this dialog. + * @param value Any value passed to this function will be attached to the object which resolves on the close promise for this dialog. * For dialogs opened with the openConfirm() method the value is used as the reject reason. */ closeThisDialog(value?: any): void; @@ -102,4 +107,4 @@ declare module angular.dialog { */ scope?: ng.IScope; } -} \ No newline at end of file +}