Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

I like to use Popover in my AngularJS application and have included ui-bootstrap for this, but I get an injection error:

Error: [$injector:unpr] Unknown provider: ui.bootstrapProvider <- ui.bootstrap

In my index.html

<script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.13.4.js"></script>

In my controller class:

angular
    .module('app')
    .controller('TeamsController', TeamsController);

TeamsController.$inject = ['Flash', '$scope', 'ui.bootstrap'];
function TeamsController(Flash, $scope, $modal) 
{
 //Code here
}

I cant really figure out how to do this correctly.

share|improve this question

You have to include it as a dependency to your app:

angular.module('myModule', ['ui.bootstrap']);

More info on the Angular UI page.

Update

Working plunker. Note that I have removed the Flash dependency because I don't know what it is, you must add it yourself back in the script.

share|improve this answer
    
I tried this, 'angular .module('app', ['ui.bootstrap']) .controller('TeamsController', TeamsController);' but then my site would not load at all... – Nick3 Feb 19 at 9:05
    
What version of angular are you using? And there are any console errors? – Mihail Stancescu Feb 19 at 9:08
    
No errors at all, just no page... using code.angularjs.org/1.2.20/angular.js – Nick3 Feb 19 at 9:09
    
Have you tried this plunker? It's also on the Angular UI page.. – Mihail Stancescu Feb 19 at 9:13
    
I did, tried some more, but got rid of it when updating my angular-version, hopefully I can get it to work now! Thanks! – Nick3 Feb 19 at 9:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.