Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am new to angular and bootstrap, I have my login.html with LoginController.

I try to create a modal popup window, So in order to do it i need to add $modal to the controller, the current controller looks like:

angular.module('loginController', ['loginService'])
 .controller('LoginCtrl', ['$scope', 'LoginService', function($scope, LoginService) {

But when i do:

angular.module('loginController', ['loginService','ui.bootstrap'])
  .controller('LoginCtrl', ['$scope', '$modal','LoginService', function($scope, $modal,LoginService) {

I Received an error, and i am getting the following error:

Error: [$injector:modulerr] Failed to instantiate module loginController due to:
Error: [$injector:modulerr] Failed to instantiate module ui.bootstrap due to:
Error: [$injector:nomod] Module 'ui.bootstrap' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.  

I guess i need to add bootstrap-ui somewhere, maybe to:

angular.module('myApp', [
'ngRoute',
'bootstrap-ui',   -> **when i add it, i still get the exception**.   

What am i doing wrong ?

share|improve this question
    
Can you show us your html? Have you added ui-bootstrap-tpls.min.js –  Giannis Paraskevopoulos Sep 12 '14 at 8:28
    
I Am taking reference from another project, that project did not use ui-bootstrap-tpls.min.js –  ilansch Sep 12 '14 at 8:30
    
You need to add a ui-bootstrap-*.js . And of course you need to declare it on your module as you did. –  Giannis Paraskevopoulos Sep 12 '14 at 8:32
    
I thought it was inside bootstrap js, but i suspected also what you have said and when i searched the references project for string ui-bootstrap-tpls.min.js i could not find it since they references ui-bootstrap-tpls.js.. Thanks alot - works –  ilansch Sep 12 '14 at 8:38
    
Good to know it helped. I moved it to the answers section. –  Giannis Paraskevopoulos Sep 12 '14 at 8:42

1 Answer 1

up vote 1 down vote accepted

You need to reference one of ui-bootstrap-*.js files in your html.

share|improve this answer

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.