1

I'm having issues getting angular-bootstrap to load in my app

 [$injector:modulerr] Failed to instantiate module RecipeSite 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. 

I have ui-bootstrap dependency in my module and I imported the library but I'm still having the issue. I've been looking at posts similar to this and playing with it, but I can't seem to get the console error to go away. Any suggestions?

app.js

var app = angular.module('RecipeSite', ['ngRoute', 'ngAnimate', 'ui-bootstrap']);

index.html

    <!DOCTYPE html>
<html ng-app="RecipeSite">
<head>
    <title>Directives Practice</title>


<script src="bower_components/angular/angular.js"></script>
    <script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
    <script src="bower_components/jquery/dist/jquery.js"></script>
    <script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="app.css">
    <script src="app.js"></script>
</head>
<body>
    <div class="container">
    <div id="header">
        <div class="row">

        <div class="col-md-offset-3 col-md-6"> 


            {{"Test Site"}}


            </div>
</div> <!--end row-->
<hr class="hrstyle">

        </div> <!--end header-->


    </div> <!--end container-->

    <div class="container">
    <div class="row">




</div>

</div>

</body>
</html>

1 Answer 1

3

At first, you have to install the angular-bootstrap with bower:

bower install angular-bootstrap

Also you have a typo, it's ui.bootstrap, not ui-bootstrap.

Change your module to:

var app = angular.module('RecipeSite', ['ngRoute', 'ngAnimate', 'ui.bootstrap']);
Sign up to request clarification or add additional context in comments.

6 Comments

I updated that and now get failed to instantiate module ui.bootstrap due to: Error: [$injector:nomod] Module 'ui.bootstrap' is not available!
Don't change your question! Or the answers will make absolutely no sense!
Sorry. I won't touch that part then. But in the code I do get that error now
I installed the library through bower and I updated ui-bootstrap in the dependency injection to ui.bootstrap, but issue still persists
It should work.. Plunker
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.