mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
Added interface for Angular Material Prompt Dialog added in 1.1.0-rc1 (2016-03-09) extending IPresetDialog<T> and included cancel() and placeholder() methods. (#9420)
This commit is contained in:
committed by
Masahiro Wakame
parent
e8357a2f9d
commit
c851b46f11
@@ -55,6 +55,18 @@ myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material.
|
||||
$scope['confirmDialog'] = () => {
|
||||
$mdDialog.show($mdDialog.confirm().htmlContent('<span>Confirm!</span>'));
|
||||
};
|
||||
$scope['promptDialog'] = () => {
|
||||
$mdDialog.show($mdDialog.prompt().textContent('Prompt!'));
|
||||
};
|
||||
$scope['promptDialog'] = () => {
|
||||
$mdDialog.show($mdDialog.prompt().htmlContent('<span>Prompt!</span>'));
|
||||
};
|
||||
$scope['promptDialog'] = () => {
|
||||
$mdDialog.show($mdDialog.prompt().cancel('Prompt "Cancel" button text'));
|
||||
};
|
||||
$scope['promptDialog'] = () => {
|
||||
$mdDialog.show($mdDialog.prompt().placeholder('Prompt input placeholder text'));
|
||||
};
|
||||
$scope['hideDialog'] = $mdDialog.hide.bind($mdDialog, 'hide');
|
||||
$scope['cancelDialog'] = $mdDialog.cancel.bind($mdDialog, 'cancel');
|
||||
});
|
||||
|
||||
6
angular-material/angular-material.d.ts
vendored
6
angular-material/angular-material.d.ts
vendored
@@ -59,6 +59,11 @@ declare namespace angular.material {
|
||||
interface IConfirmDialog extends IPresetDialog<IConfirmDialog> {
|
||||
cancel(cancel: string): IConfirmDialog;
|
||||
}
|
||||
|
||||
interface IPromptDialog extends IPresetDialog<IPromptDialog> {
|
||||
cancel(cancel: string): IPromptDialog;
|
||||
placeholder(placeholder: string): IPromptDialog;
|
||||
}
|
||||
|
||||
interface IDialogOptions {
|
||||
templateUrl?: string;
|
||||
@@ -90,6 +95,7 @@ declare namespace angular.material {
|
||||
show(dialog: IDialogOptions|IAlertDialog|IConfirmDialog): angular.IPromise<any>;
|
||||
confirm(): IConfirmDialog;
|
||||
alert(): IAlertDialog;
|
||||
prompt(): IPromptDialog;
|
||||
hide(response?: any): angular.IPromise<any>;
|
||||
cancel(response?: any): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user