0

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 ?

5
  • Can you show us your html? Have you added ui-bootstrap-tpls.min.jsCommentedSep 12, 2014 at 8:28
  • I Am taking reference from another project, that project did not use ui-bootstrap-tpls.min.js
    – ilansch
    CommentedSep 12, 2014 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.CommentedSep 12, 2014 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
    CommentedSep 12, 2014 at 8:38
  • Good to know it helped. I moved it to the answers section.CommentedSep 12, 2014 at 8:42

1 Answer 1

1

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

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.