大佬教程收集整理的这篇文章主要介绍了angularjs – 从子模态控制器(ui bootstrap)调用父控制器方法,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
App.controller('MailFolderController',['$scope','$http','$timeout','$stateParams','$window','mails','$interval',function ($scope,$http,$timeout,$stateParams,$window,mails,$interval) { $scope.check = function(){ console.log("call parent ==========>") } App.controller('orderCancellationController','$modal',$modal) { $scope.open = function (mail) { var modalInstance = $modal.open({ templateUrl: '/orderCancellationBox.html',controller: ModalInstanceCtrl,resolve: { mail: function () { return mail; } } }); }; // Please note that $modalInstance represents a modal window (instancE) dependency. // it is not the same as the $modal service used above. var ModalInstanceCtrl = function ($scope,$modalInstance,mail) { $scope.mail = mail; $scope.submit = function () { $scope.$parent.check(); $modalInstance.close('closed'); }; $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; }; ModalInstanceCtrl.$inject = ["$scope","$modalInstance",'mail']; }]); }]);
bootstrap中的模态有一个’scope’选项,
$scope.open = function (mail) { var modalInstance = $modal.open({ templateUrl: '/orderCancellationBox.html',scope: $scope,resolve: { mail: function () { return mail; } } }); };
以上是大佬教程为你收集整理的angularjs – 从子模态控制器(ui bootstrap)调用父控制器方法全部内容,希望文章能够帮你解决angularjs – 从子模态控制器(ui bootstrap)调用父控制器方法所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。