title: Error: $controller:ctrlreg A controller with the name 'HeaderCntrl' is not registered
body: <p>I have written an angular js program and I have written the controller in a different file but I am getting the error saying that controller is not registered. can someone let me know why i am getting this.</p>
  
  <pre><code>&lt;html ng-app&gt;
  &lt;head&gt;
  &lt;title&gt;The angular book libraty&lt;/title&gt;
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"&gt;
  &lt;link rel="stylesheet" href="app.css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="header-wrapper" ng-controller="HeaderCntrl"&gt;
  &lt;span class="logo pull-left"&gt;{{appDetails.title}}&lt;/span&gt;
  &lt;span class="tagline pull-left"&gt;{{appDetails.tagline}}&lt;/span&gt;
  &lt;div class="nav-wrapper pull-left"&gt;
  &lt;ul class="nav nav-pills"&gt;
  &lt;li class="active"&gt;&lt;a href="#"&gt;Book&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#"&gt;Kart&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;script type="text/javascript" src="app.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="angular.min.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And the controller code, that is written in the separate js file.</p>
  
  <pre><code>var HeaderCntrl = function($scope){
      $scope.appDetails = {
          title : "BookKart",
          tagline : "The collection of a million books"
  };
  }
  </code></pre>