angularjs – $uibModal.open()不是函数
发布时间:2020-12-17 06:51:26 所属栏目:安全 来源:网络整理
导读:我正在尝试集成Angular bootstrap模态形式, 这是我的控制器 angular.module('app').controller('groupController',['groupService','$uibModal','toastr','$scope',function(groupService,toastr,$uibModal,$scope) 我添加了$uibModal作为依赖.在我的app.js
我正在尝试集成Angular bootstrap模态形式,
这是我的控制器 angular.module('app').controller('groupController',['groupService','$uibModal','toastr','$scope',function(groupService,toastr,$uibModal,$scope) 我添加了$uibModal作为依赖.在我的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',$scope) 订单必须根据注入维护. 试试这样吧 'groupService',$scope) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |