$uibModal.open() 不是函数

$uibModal.open() is not a function

我正在尝试整合 Angular bootstrap 模态形式,

这是我的控制器

angular.module('app').controller('groupController',['groupService','$uibModal','toastr','$scope',function(groupService,toastr,$uibModal,$scope)

我添加了 $uibModal 作为 dependency.In 我的 app.js 我也添加了 ui.bootstrap 作为依赖,

我的angular.bootstrap版本是1.3.3

我的模态函数如下

vm.viewGroupDetail = function(userDetails) {

    var scope = $scope.$new();
    scope.userDetails = userDetails;

    vm.modalInstance = $uibModal.open({
        animation: true,
        templateUrl: 'app/views/groups/group_details_modal.html',
        windowClass: 'd-modal',
        size: 'md',
        scope: scope
        // resolve: {
        //  userDetails: function () {
        //      return ;
        //  }
        // }
    });



};

当我尝试使用断点并检查控制流时,它进入了 viewGroupDetail 函数。但在 $uibModal.open() 点,控制中断

我在这里错过了什么? 我在堆栈溢出中尝试了其他相关问题,没有任何解决方案,所以发布我自己的查询

您在参数声明中的错误位置张贴了 $uibModal

'groupService','$uibModal','toastr','$scope',function(groupService,toastr,$uibModal,$scope)

必须按照inject维持顺序

这样试试

'groupService','$uibModal','toastr','$scope',function(groupService,$uibModal,toastr,$scope)