1

there i want to apply $mdDialog to the following angular function and I'm using angularjs 1.6.4. $mdDialog should prompt a message to select Yes or no to delete the file. Here is my code

$scope.deleteFile = function (key) {
                    $scope.documentEventText = "Document Deleted";
                    FileResourceService.deleteFile('KeyPhotos', key, $state.params.propertyId, $scope.key.id, $scope.getFiles);
                }
1
  • Please upvote the answer if it helped Commented Jan 3, 2018 at 2:40

1 Answer 1

1

Open the dialog inside the function as follows,

 var confirm = $mdDialog.confirm({
      controller: DialogController,
      templateUrl: 'dialog1.tmpl.html',
      parent: angular.element(document.body),
      targetEvent: ev,
    })
    $mdDialog.show(confirm).then(function() {
      $scope.status = 'Confirmed';
    }

DEMO

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.