Merge pull request #21649 from eknowles/master

Add required in prompt to angular material
This commit is contained in:
Benjamin Lichtman
2017-11-21 10:48:56 -08:00
committed by GitHub
2 changed files with 4 additions and 0 deletions

View File

@@ -140,6 +140,9 @@ myApp.controller('DialogController', ($scope: TestScope, $mdDialog: ng.material.
$scope['promptDialog'] = () => {
$mdDialog.show($mdDialog.prompt().initialValue('Buddy'));
};
$scope['promptDialog'] = () => {
$mdDialog.show($mdDialog.prompt().required(true));
};
$scope['prerenderedDialog'] = () => {
$mdDialog.show({
template: '<md-dialog>Hello!</md-dialog>',

View File

@@ -80,6 +80,7 @@ declare module 'angular' {
interface IPromptDialog extends IPresetDialog<IPromptDialog> {
cancel(cancel: string): IPromptDialog;
required(required: boolean): IPromptDialog; // default: false
placeholder(placeholder: string): IPromptDialog;
initialValue(initialValue: string): IPromptDialog;
}