I have a contact form inside my modal window. After successful post request i want to close the modal automatically. I am using MEAN.JS
here is my controller
angular.module('core').controller('FormCtrl',['$scope','$http', function($scope,$http) { $scope.postMail = function (data) { $http.post('/mail', data). success(function(data, status, headers, config) { alert('success'); //close function....?? }). error(function(data, status, headers, config) { }); }; }]);//formController ends How can i close my modal after $http.post success?
$modalInstance.dismiss('cancel');but it saying .dismiss in undefined.