Gorakh Nath
Gorakh Nath

Reputation: 9858

using $mdDialog.confirm() closing the parent page

I have open a template by using $mdDialog.show() like this:-

 $mdDialog.show({
skipHide: true,
 controller: 'EditController',
templateUrl: 'app/View/Edit.html',
parent: angular.element(document.body),
clickOutsideToClose: false
});

Now I am tring to show the alert before saving the data by using the $mdDialog.confirm() like this:-

  var confirm = $mdDialog.confirm()                                                 .parent(angular.element(document.body))
    .content('Are you sure to save the document? ')
    .ok('Save')
    .cancel('Cancel')
$mdDialog.show(confirm).then(function () {}
    ,function () { $mdDialog.hide();
        });

Issue : Closing the opened template after opening the alert.

Upvotes: 3

Views: 2743

Answers (1)

Bilal Ahmed Yaseen
Bilal Ahmed Yaseen

Reputation: 2664

Multiple dialogues can be opened at the same time:

Using the multiple option for the $mdDialog service allows developers to show multiple dialogs at the same time.

Example:

// From plain options
$mdDialog.show({
      multiple: true
});

// From a dialog preset
$mdDialog.show(
      $mdDialog
     .confirm()
     .multiple(true)
);

Here is the Reference for this.

Upvotes: 4

Related Questions