使用bower添加ui.bootstrap依赖项

use*_*928 42 angularjs angular-ui bower

我试图将ui.bootstrap依赖项添加到我的角项目中(我使用yeoman,bower).我这样做了:

  1. 哟角
  2. 凉亭安装angular-ui
  3. 然后我添加到我的index.html文件中:和
  4. 咕噜声

然后我将ui.bootstrap依赖项添加到我的app.js:

angular.module('angularuiprojectApp', [
  'ngCookies',
  'ngResource',
  'ngSanitize',
  'ngRoute', 'ui.bootstrap'])
Run Code Online (Sandbox Code Playgroud)

当我尝试访问Chrome上的index.html时出现此错误:

未捕获错误:[$ injector:modulerr]由于以下原因无法实例化angularuiprojectApp模块:错误:[$ injector:modulerr]由于以下原因无法实例化模块ui.bootstrap:错误:[$ injector:nomod]模块'ui.bootstrap'是无法使用!你要么...... 1)

我不知道我错在哪里,如果有人可以帮助我...谢谢.

pko*_*rce 59

你正在从凉亭安装一个错误的包裹.正确的安装方法bower install angular-bootstrap如下所述:https://github.com/angular-ui/bootstrap#installation

编辑:

截至2015年2月,该库的Bower版本存在于https://github.com/angular-ui/bootstrap-bower.

不幸的是,它目前只包含AngularUI Bootstrap 0.12.0,据我所知,它与Angular> = 1.3不完全兼容.看起来维护者希望AngularUI Bootstrap> = 0.13.0与Angular 1.3,<>兼容,但该版本的库似乎尚未进入Bower兼容的repo.
不再是问题,现在提供并支持AngularUI Bootstrap 0.13.0版本.

  • 下次使用-S或--save安装时可以保存 (6认同)
  • 使用安装angular-bootstrap也没有工作,我不得不手动更新bower.json以添加依赖项.在那之后,它奏效了. (2认同)