42

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

  1. yo angular
  2. bower install angular-ui
  3. I then added to my index.html file : and
  4. grunt serve

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

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

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

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.

user1260928
  • 3,269
  • 9
  • 59
  • 105
  • Are you sure you added the correct file to `index.html`? Has it perhaps been replaced by ill-configured `bower-install`? Do you get any `404` errors in the browser? – Mikke Mar 04 '14 at 17:28

3 Answers3

59

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

Edit:

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

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.

maljukan
  • 2,148
  • 2
  • 25
  • 35
pkozlowski.opensource
  • 117,202
  • 60
  • 326
  • 286
3

install the bower version that depends on the angular version that your project uses.

I first installed;

bower install angular-ui-bootstrap-bower#0.13.4

Then I added below to bower.json

"angular-ui-bootstrap-bower": "0.13.4"
Caner
  • 1,448
  • 23
  • 38
  • 1
    You can execute "bower install angular-ui-bootstrap-bower#0.13.4 --save" <-- add the "--save". That will add the dependency to your bower.json for you. – mvermand Oct 28 '15 at 10:39
3
bower install angular-ui-bootstrap --save

This also works.

Please refer to this answer if you have any issue with the version installed by bower. There seems to be some version issues with ui-boostrap quoting the answer

Community
  • 1
  • 1