My HTML page includes AngularJS components. Below is the code snippet:
<!DOCTYPE html>
<html ng-app="MyApp">
<head>
<base href="/">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ShowTrackr</title>
<link rel="icon" type="image/png" href="favicon.png"/>
<link href="stylesheets/style.css" rel="stylesheet">
</head>
<body>
<!-- Nav Bar -->
<div class="navbar navbar-default navbar-static-top"
role="navigation" bs-navbar>
<div class="navbar-header">
<a class="navbar-brand" href="/">
<span class="glyphicon glyphicon-film"></span>
Show<strong>Trackr</strong></a>
</div>
<ul class="nav navbar-nav">
<li data-match-route="/$"><a href="/">Home</a></li>
<li data-match-route="/add"><a href="/add">Add</a></li>
</ul>
<ul class="nav navbar-nav pull-right" ng-if="!currentUser">
<li data-match-route="/login"><a href="/login">Login</a></li>
<li data-match-route="/signup"><a href="/signup">Sign up</a></li>
</ul>
<ul class="nav navbar-nav pull-right" ng-if="currentUser">
<li class="navbar-text" ng-bind="currentUser.email"></li>
<li><a href="javascript:void(0)" ng-click="logout()">Logout</a></li>
</ul>
</div>
<div ng-view></div>
<script src="vendor/angular.js"></script>
<script src="vendor/angular-strap.js"></script>
<script src="vendor/angular-strap.tpl.js"></script>
<script src="vendor/angular-messages.js"></script>
<script src="vendor/angular-resource.js"></script>
<script src="vendor/angular-route.js"></script>
<script src="vendor/angular-cookies.js"></script>
<script src="vendor/moment-with-locales.js"></script>
<script src="app.js"></script>
</body>
</html>
The app.js file configures the AngularJS module and loads additional modules:
angular.module('MyApp', ['ngCookies', 'ngResource', 'ngMessages', 'ngRoute', 'mgcrea.ngStrap'])
.config(function() {
});
Upon loading the HTML file in a browser, an AngularJS error occurs:
Uncaught Error: [$injector:modulerr] Failed to instantiate module MyApp due to:
Error: [$injector:nomod] Module 'MyApp' 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.
...
The version of AngularJS being used is 1.3.5. Can someone point out where the mistake might be?