Angularjs 加载引导ui角度模型时出错
我是angular和bootstrap的新手,我的login.html带有LoginController 我尝试创建一个模式弹出窗口,因此为了实现这一点,我需要向控制器添加$modal,当前控制器如下所示:Angularjs 加载引导ui角度模型时出错,angularjs,twitter-bootstrap,angular-ui-bootstrap,Angularjs,Twitter Bootstrap,Angular Ui Bootstrap,我是angular和bootstrap的新手,我的login.html带有LoginController 我尝试创建一个模式弹出窗口,因此为了实现这一点,我需要向控制器添加$modal,当前控制器如下所示: angular.module('loginController', ['loginService']) .controller('LoginCtrl', ['$scope', 'LoginService', function($scope, LoginService) { 但当我这样做的
angular.module('loginController', ['loginService'])
.controller('LoginCtrl', ['$scope', 'LoginService', function($scope, LoginService) {
但当我这样做的时候:
angular.module('loginController', ['loginService','ui.bootstrap'])
.controller('LoginCtrl', ['$scope', '$modal','LoginService', function($scope, $modal,LoginService) {
我收到一个错误,我得到以下错误:
Error: [$injector:modulerr] Failed to instantiate module loginController due to:
Error: [$injector:modulerr] Failed to instantiate module ui.bootstrap due to:
Error: [$injector:nomod] Module 'ui.bootstrap' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
我想我需要在某个地方添加引导ui,可能是为了:
angular.module('myApp', [
'ngRoute',
'bootstrap-ui', -> **when i add it, i still get the exception**.
我做错了什么?您需要在
html
中引用ui引导-*.js
文件中的一个文件,您能给我们看看您的html吗?您是否添加了ui-bootstrap-tpls.min.js
我正在参考另一个项目,该项目没有使用ui-bootstrap-tpls.min.js您需要添加ui-bootstrap-*.js。当然,你需要像你那样在你的模块上声明它。我以为它在bootstrap js中,但我也怀疑你所说的,当我在引用项目中搜索字符串ui-bootstrap-tpls.min.js时,我找不到它,因为它们引用了ui-bootstrap-tpls.js。。非常感谢-很高兴知道它有帮助。我把它移到了答案部分。