我正在尝试将ui.bootstrap依赖项添加到我的Angular项目中(我使用的是yeoman和bower)。 我做了这个:
- yo angular
- bower install angular-ui
- 然后我在我的index.html文件中添加了:<script src="bower_components/angular-ui-bootstrap/ui-bootstrap-tpls.js"></script> 和 <link rel="stylesheet" href="bower_components/angular-ui-bootstrap/ui-bootstrap-csp.css">
- grunt serve
然后我将ui.bootstrap依赖项添加到我的app.js中:
angular.module('angularuiprojectApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ngRoute', 'ui.bootstrap'])
当我尝试在Chrome上访问我的index.html时,出现以下错误:
Uncaught Error: [$injector:modulerr] 无法实例化模块angularuiprojectApp,原因是:Error: [$injector:modulerr] 无法实例化模块ui.bootstrap ,原因是:Error: [$injector:nomod] 模块'ui.bootstrap'不可用!您可以......1)
我不知道哪里错了,如果有人能帮忙解决这个问题就太好了... 谢谢。
index.html
中了吗?它是否被配置不当的bower-install
替换了?在浏览器中是否出现任何404
错误? - Mikke