angular
.module('angProj')
.controller('UserCtrl',
['$scope', '$uibModal',
function ($scope, $uibModal) {
$scope.results = function (content, completed) {
var modalInstance = $uibModal.open({
backdrop: 'static',
keyboard: false,
animation: $scope.animationsEnabled,
templateUrl: '/Scripts/angularApp/views/user-modal.html',
controller: 'UserModalCtrl',
resolve: {
items: function () {
return $scope.items;
}
}
});
if (!completed || content.length === 0) {
return;
}
modalInstance.close();
modalInstance.dismiss('cancel');
I am not able to close the model on user add completion.. On user-modal i am showing progress bar.. the code runs fine without error but the modal remains open. I also tried $uibModalInstance but the controller throws error: unknown provider (not able to inject $uibModalInstance on the same UserCtrl) I am injecting ui.bootstrap (ui-bootstrap-tpls-1.1.2.js)
Thanks for your time.
Use modalInstance.close()
inside your UserModalCtrl
controller
app.controller('UserModalCtrl', ['$scope', '$modalInstance' function($scope ,modalInstance {
$scope.close = function () {
modalInstance.close();
};
}]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With