I was trying to navigate from a modal in a page to another page by adding a function to ng-click. When I remove the function assigned to ng-click, the data-dismiss works properly and the modal gets removed. But when I use the ng-click with a function, which redirects to an alternative page, it gets directed to the page, but the modal has not been dismissed. (the new page seems in the disabled state)
<button type="button" class="btn btn-success" ng-click="addNewProject()"
data-dismiss="modal">Add Project</button>
The addNewProject() function redirects to the other page and adds the details in the modal to the database. I would like to know a way to get the page which was loaded later, in the editable way. (the modal should be pletely removed.)
I was trying to navigate from a modal in a page to another page by adding a function to ng-click. When I remove the function assigned to ng-click, the data-dismiss works properly and the modal gets removed. But when I use the ng-click with a function, which redirects to an alternative page, it gets directed to the page, but the modal has not been dismissed. (the new page seems in the disabled state)
<button type="button" class="btn btn-success" ng-click="addNewProject()"
data-dismiss="modal">Add Project</button>
The addNewProject() function redirects to the other page and adds the details in the modal to the database. I would like to know a way to get the page which was loaded later, in the editable way. (the modal should be pletely removed.)
Share Improve this question asked Dec 17, 2014 at 5:32 Rajith Gun HewageRajith Gun Hewage 5327 silver badges25 bronze badges2 Answers
Reset to default 13$(".modal-backdrop").hide();
Adding the above line in the ng-click function got rid of the issue.
Please have a look at http://angular-ui.github.io/bootstrap/
Refer Closing Twitter Bootstrap Modal From Angular Controller
$scope.close = function(result){ dialog.close(result); };
or
use this inside ng-click function
$('#myModal').modal('hide');