I am encountering an error while working on my AngularJS program. I have defined the controller in a separate file but it keeps saying that the controller is not registered. Can someone please help me understand why this issue is happening?
<html ng-app>
<head>
<title>The angular book library</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="app.css">
</head>
<body>
<div id="header-wrapper" ng-controller="HeaderCntrl">
<span class="logo pull-left">{{appDetails.title}}</span>
<span class="tagline pull-left">{{appDetails.tagline}}</span>
<div class="nav-wrapper pull-left">
<ul class="nav nav-pills">
<li class="active"><a href="#">Book</a></li>
<li><a href="#">Kart</a></li>
</ul>
</div>
</div>
<script type="text/javascript" src="app.js"></script>
<script type="text/javascript" src="angular.min.js"></script>
</body>
</html>
Furthermore, here is the code for the controller which is stored in a separate JavaScript file.
var HeaderCntrl = function($scope){
$scope.appDetails = {
title : "BookKart",
tagline : "The collection of a million books"
};
}