Skip to content Skip to sidebar Skip to footer

Ui-bootstrap-dialog Closing

To close modal window one should call function modal.close(result). close(result) - a method that can be used to close a modal, passing a result What is result here? What is the

Solution 1:

Assuming you close the modal with something :

close(something)

You can get this something in the promise $modalInstance.result:

$modalInstance.result.then(function (something) { 
    // ... 
}

See ui-bootstrap modal documentation and plunker for reference.

Solution 2:

You can have your result of an operation at the modal back to the controller.

 modalInstance.result.then(function (selectedItem) {
      $scope.selected = selectedItem;
    }, function () {
      $log.info('Modal dismissed at: ' + new Date());
    });
  };

Look at this plunker link

Post a Comment for "Ui-bootstrap-dialog Closing"