我的模式窗口中有一个联系表单。成功发布请求后,我想关闭 modal自动地。我正在使用 MEAN.JS
这是我的 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
$http.post 成功后如何关闭我的模式?
最佳答案
我有东西给你
使用:- $modalStack
然后调用$modalStack.dismissAll();
简单plunker
我在 plunkler 中使用了 $timeout
你可以在任何地方使用它,比如 $http
:-)
关于angularjs - 从 Controller 关闭 Angular 引导模式窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28498146/