簡體   English   中英

AngularJS $ injector:Angular Bootstrap模式的unpr問題

[英]AngularJS $injector:unpr issue with Angular Bootstrap modal

所以當我嘗試將$ modal注入我的控制器時,我得到一個錯誤:[$ 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">行。 之后只有你應該創建模塊和控制器。

試試以下代碼:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM