Wiring up AngularUI to Bootstrap 3 throwing errors

2019-06-01 01:23发布

问题:

I have been trying to wire up AngularUI to Bootstrap 3 to no avail. I grabbed the appropriate AngularUI code from the bootstrap 3 branch here: https://github.com/angular-ui/bootstrap/tree/bootstrap3_bis2

I picked the AngularUI tooltip directive as an easy "test-case" to see if I can get it all wired up.

There error I am receiving is: Uncaught Error: No module: ui.bootstrap

I've shared a dropbox link with src code below.

Views/Home/index.cshtml contains the markup with references to angularjs and bootstrap
js/directives contains the only directive I am currently testing out which is the "tooltip" directive.

Dropbox link with src code https://www.dropbox.com/sh/elwn0su5qwnqa27/zetaMxAa4Q

Instead of my having to download the bootstrap 3 directives and place them manually in my project, is there now a CDN available for AngularUI-Bootstrap3 directives like there is for AngularUI-Bootstrap2?

Thanks for any help,

V/R

Chris

回答1:

It's because you try to extract only one part of AngularUI sources, not compiled version.

So you lack the module declaration for 'ui.bootstrap' (and surely other pieces).

As Bootstrap 3 compatibility is not done, there is no compiled version (and no more CDN) for this AngularUI version.

You have to get all sources from branch bootstrap3_bis2, and build them with grunt. It's explain in project README (Contributing to the project > Build).

It will generate 2 JS files (one is minified and the other is not) you have to include one of them to your page and it will works correctly.