2016-04-15 113 views
0

我AngularJs.I新有錯誤

Error: $injector:unpr Unknown Provide 

angularjs

var App = angular.module('StartModule', ["ui.bootstrap"]); 
App.controller('ModalDemoCtrl', ['$scope', '$uibModal', function ($scope, $uibModal) { 
$scope.test = function() {}}); 

當我添加$ uibModal

出現錯誤
+0

可我知道angularjs版本? – kiro112

+0

您是否在index.html中注入了「ui-bootstrap」相關條目? –

+0

如果您使用的是bower依賴關係,則應該包含這個選項。 –

回答

0

進樣$ uibModalInstance依賴項。並使用$ uibModalInstance.dismiss('取消')等事件。

var App = angular.module('StartModule', ["ui.bootstrap"]); 
 
App.controller('ModalDemoCtrl', ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) { 
 
$scope.test = function() {}});

+0

我有同樣的錯誤 – user5555160

+1

@ user5555160我可以知道您使用的是哪個角度的ui引導程序版本嗎? –

+0

*版本:1.3.1 - 2016-04-05 – user5555160

相關問題