使用 bower 添加 ui.bootstrap 依赖项 [英] Adding ui.bootstrap dependency with bower

查看:30
本文介绍了使用 bower 添加 ui.bootstrap 依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 ui.bootstrap 依赖项添加到我的 angular 项目中(我正在使用 yeoman、bower).我这样做了:

I m trying to add ui.bootstrap dependency to my angular project (I m using yeoman, bower). I did this :

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

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

Then I added the ui.bootstrap dependency to my app.js:

angular.module('angularuiprojectApp', [
  'ngCookies',
  'ngResource',
  'ngSanitize',
  'ngRoute', 'ui.bootstrap'])

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

When I m trying to access to my index.html on Chrome I m getting this error :

未捕获的错误:[$injector:modulerr] 无法实例化模块angularuiprojectApp 由于:错误:[$injector:modulerr] 失败实例化模块 ui.bootstrap 由于:错误:[$injector:nomod]模块ui.bootstrap"不可用!你要么......1)

Uncaught Error: [$injector:modulerr] Failed to instantiate module angularuiprojectApp due to: Error: [$injector:modulerr] Failed to instantiate module ui.bootstrap due to: Error: [$injector:nomod] Module 'ui.bootstrap' is not available! You either ......1)

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

I don't know where I m wrong, if someone can help me on this... Thanks.

推荐答案

您从 bower 安装了错误的包.正确安装的是 bower install angular-bootstrap,如下所述:https://github.com/angular-ui/bootstrap#installation

You are installing a wrong package from bower. The correct one to install is bower install angular-bootstrap as described here: https://github.com/angular-ui/bootstrap#installation

编辑:

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

As of February 2015, a Bower version of the library exists at https://github.com/angular-ui/bootstrap-bower.

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

Unfortunately, it presently only contains AngularUI Bootstrap 0.12.0 which, as far as I can tell, isn't fully compatible with Angular >= 1.3. It looks like the maintainers intend AngularUI Bootstrap >= 0.13.0 to be compatible with Angular 1.3, <>but that version of the library seems not to have made its way to the Bower-compatible repo yet.
No longer an issue, AngularUI Bootstrap 0.13.0 version is now provided and supported.

这篇关于使用 bower 添加 ui.bootstrap 依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆