从控制器关闭角度引导模式窗口

Har*_*esh 2 angularjs angular-ui angularjs-directive bootstrap-modal meanjs

我的模态窗口中有一个联系表格。成功发布请求后,我想自动关闭模态。我正在使用 MEAN.JS

这是我的控制器

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
Run Code Online (Sandbox Code Playgroud)

$http.post 成功后如何关闭我的模式?

squ*_*oid 5

我有东西给你

用:- $modalStack

然后打电话 $modalStack.dismissAll();

简单的plunker

$timeout在 plunkler 中使用过,你可以在任何地方使用它$http:-)

文件