Unable to load angular controller file while running server side using nodejs
<p>when the controller code is written in the same html file, code works.
But as soon as I separate the controller code into myController.js file and mention the js file in the src attribut I get an $injector module error.
This is the error</p>

<pre><code>Failed to load resource: the server responded with a status of 404 (Not Found)
angular.js:4547 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.
</code></pre>

<p>This is my angular controller</p>

<pre><code>var app = angular.module('myApp',[]);
app.controller('myCtrl',['$scope','$http', function($scope, $http) {

  $scope.submitForm=function(){ 

$http({
   method:"POST",
   url:"http://localhost:7000/frmAng/",
   headers : { 'Content-Type' : 'application/json'},
   data : {
       name : $scope.name,
       pwd : $scope.pwd
   }
}).then(function(response) {
      $scope.resFrmServer = response.data;
   },function(response){
      $scope.resFrmServer = response.statusText;
    });
  };  
}]);
</code></pre>

<p>How do I overcome this ? As, I want to separate out all js files for further minification.</p>

<p>Complete html file with angular code.</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js'&gt;&lt;/script&gt;
&lt;/head&gt;    
&lt;body&gt;



&lt;div ng-app="myApp" ng-controller="myCtrl" align="center" &gt; 

&lt;hr&gt;

&lt;form &gt;
    Name: &lt;input type="text" ng-model="name"  required autofocus&gt;&lt;br&gt;&lt;br&gt;
     Password:&lt;input type="password" ng-model="pwd"&gt;&lt;br&gt;&lt;br&gt; 
    &lt;input type="submit" ng-click="submitForm()" text="Submit"&gt;
&lt;/form&gt;
&lt;h1&gt;{{resFrmServer}}&lt;/h1&gt;     
&lt;/div&gt;
&lt;script &gt;
var app = angular.module('myApp',[]);
app.controller('myCtrl',['$scope','$http', function($scope, $http) {
  $scope.submitForm=function(){ 
$http({
   method:"POST",
   url:"http://localhost:7000/frmAng/",
   headers : { 'Content-Type' : 'application/json'},
   data : {
       name : $scope.name,
       pwd : $scope.pwd
   }
}).then(function(response) {
      $scope.resFrmServer = response.data;

   },function(response){
      $scope.resFrmServer = response.statusText;          
    });
  };  
}]);

&lt;/script&gt;
</code></pre>

<p>
</p>