mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
ng-dialog
create IDialogClosePromise type to be returned by closePromise.
This commit is contained in:
parent
32029fcb4e
commit
89eaaa5d5e
@ -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"
|
||||
})
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
15
ng-dialog/ng-dialog.d.ts
vendored
15
ng-dialog/ng-dialog.d.ts
vendored
@ -26,14 +26,19 @@ declare module angular.dialog {
|
||||
interface IDialogOpenResult {
|
||||
id: string;
|
||||
close: (value?: string) => void;
|
||||
closePromise: IPromise<void>;
|
||||
closePromise: IPromise<IDialogClosePromise>;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user