title: Angularjs routing issue, controller not loading
body: <p>I have 4 files:</p>
  
  <ul>
  <li>index.html</li>
  <li>logic.js</li>
  <li>controller.js</li>
  <li>homepage.html</li>
  </ul>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;html ng-app="sample"&gt;
  &lt;head&gt;
  &lt;script src="angular.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div&gt;
      &lt;div ng-view&gt;&lt;/div&gt;
  &lt;/div&gt;    
      &lt;script src="controller.js"&gt;&lt;/script&gt;
      &lt;script src="logic.js"&gt;&lt;/script&gt;    
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>logic.js</strong></p>
  
  <pre><code>var myapp = angular.module('sample',[]);
      myapp.config(function($routeProvider)
      {
          $routeProvider
              .when('/',
                  {   
                      controller:homepageCtrl,
                      templateUrl:'homepage.html'             
              });
      });
  </code></pre>
  
  <p><strong>controller.js</strong></p>
  
  <pre><code>function homepageCtrl($scope){
          $scope.name = "ROHIT";}
  </code></pre>
  
  <p><strong>homepage.html</strong></p>
  
  <pre><code>{{name}}
  </code></pre>
  
  <p>homepage.html is loading and being displayed correctly by the route but the controller is not being called here when homepage.html is loaded into index.html.</p>
  
  <p>Kindly help me out with this.</p>
  
  <p>Thanks</p>