3

So i'm getting a Error: [$injector:unpr] when I try and inject $modal into my controller.

here is what I have:

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>
4

1 回答 1

0

你必须把<script src="vendor/angular-bootstrap/ui-bootstrap-tpls.js">线放在顶部。之后,只有您应该创建模块和控制器。

试试下面的代码:

<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)
于 2016-06-27T17:00:26.103 回答