The official documentation of AngularJS does not contain anything that describes how $uibModalInstance.close
works, in the following code fragment, scope.close
is a method used to close the modal window and pass an object to the caller controller
var app = angular.module('myApp');
app.controller('ModalController', ['$uibModalInstance', modalControllerFn]);
function modalControllerFn($uibModalInstance) {
var scope = this;
// some data object
scope.data = {key1: "value1", key2: "value2"};
scope.close = function() {
$uibModalInstance.close(scope.data);
}
}