我从angular-seed开始,开始了一个AngularJS项目,以便对它有所了解。
我正在尝试加载angular-bootstrap,但当我在app.js文件依赖项中添加模块时:
angular.module('myApp', [
'ngRoute',
'ui.utils',
'ui.bootstrap', //<------
'myApp.filters',
'myApp.services',
'myApp.directives',
'myApp.controllers'
]) 当我运行我的应用程序时,我得到了以下错误:
[$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.我已经安装了angular-bootstrap,文件位于我的app/bower-components目录中:
├── angular-bootstrap
│ ├── bower.json
│ ├── ui-bootstrap.js
│ ├── ui-bootstrap.min.js
│ ├── ui-bootstrap-tpls.js
│ └── ui-bootstrap-tpls.min.js根据安装说明中的设置,我在index.html文件中引用了bootstrap.css和angular.js。
我知道还有另一个问题问到了Error: [$injector:nomod] Module 'ui.bootstrap' is not available! while Karma run in webstorm中同样的错误,但这是为了运行Karma测试,我甚至不能让模块在运行应用程序时加载。
发布于 2014-10-27 19:54:50
请确保包含指向js文件的链接
<link rel="stylesheet" href="bower_components/html5-boilerplate/css/ui-bootstrap.css">
发布于 2017-08-11 18:30:33
您还应将bootstrap (bower install bootstrap)添加到我们的应用程序中
我们应用程序中的bootstrap/dist/js/bootstrap.min.js
https://stackoverflow.com/questions/25677865
复制相似问题