Paul R
Paul R

Reputation: 2797

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 difference between close(true), close(false), close('blah-blah')>

Upvotes: 0

Views: 51

Answers (2)

Fracedo
Fracedo

Reputation: 626

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

Upvotes: 1

Michel
Michel

Reputation: 28359

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.

Upvotes: 1

Related Questions