Reputation: 2797
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
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
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