To close the $ modal that you opened, you can follow these steps.
1) Add $modalInstance to the controller that you specified when creating the modal. In your case, you named it ModalInstanceCtrl .
2) You have a function in ModalInstanceCtrl that calls .close() on $modalInstance .
your ModalInstanceCtrl should look something like this.
angular.module('myCoolApp') .controller('ModalInstanceCtrl', function ($scope, $modalInstance) { $scope.closeModal = function(){ $modalInstance.close(); } });
source share