gpt4 book ai didi

javascript - AngularJS $ 注入(inject)器 :unpr issue with Angular Bootstrap modal

转载 作者:行者123 更新时间:2023-11-29 16:02:52 25 4
gpt4 key购买 nike

因此,当我尝试将 $modal 注入(inject)我的 Controller 时,出现错误:[$injector:unpr]。

这是我的:

var controllers = angular.module("controllers", ['services', 'ngCookies','ngStorage','ui.bootstrap', 'ngRoute']);

controllers.controller("MainController", ['$scope', '$http', '$location', 'configurationData', 'dashboardData', 'orderByFilter', '$cookieStore' , 'isstevenFilterArray', '$rootScope', '$modal' , function ($scope, $http, $location, configurationData, dashboardData, orderByFilter, $cookieStore, isstevenFilterArray, $rootScope, $modal)

<script src="vendor/angular-bootstrap/ui-bootstrap-tpls.js"></script>

最佳答案

你必须输入 <script src="vendor/angular-bootstrap/ui-bootstrap-tpls.js">行在顶部。之后,只有您应该创建模块和 Controller 。

试试下面的代码:

<script src="vendor/angular-bootstrap/ui-bootstrap-tpls.js"></script>

var controllers = angular.module("controllers", ['services', 'ngCookies','ngStorage','ui.bootstrap', 'ngRoute']);

controllers.controller("MainController", ['$scope', '$http', '$location', 'configurationData', 'dashboardData', 'orderByFilter', '$cookieStore' , 'isstevenFilterArray', '$rootScope', '$modal' , function ($scope, $http, $location, configurationData, dashboardData, orderByFilter, $cookieStore, isstevenFilterArray, $rootScope, $modal)

关于javascript - AngularJS $ 注入(inject)器 :unpr issue with Angular Bootstrap modal,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38056992/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com