title: Angular routing is not working properly?
body: <p>I am trying to do routing in angular js and Server is running fine.  But angular routing is not working properly, only main.html page is coming in ng-view, second.html is not coming.  when clicked on the first and second in html same mainController is working not the secondController.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;!Doctype html&gt;
  
  &lt;html ng-app="myApp"&gt;
  &lt;meta charset=utf-8" /&gt;
   &lt;head&gt;
  
  
  &lt;script src="http://code.angularjs.org/snapshot/angular.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://code.angularjs.org/snapshot/angular-route.min.js"&gt;
  &lt;/script&gt;
  &lt;script type="text/javascript"src="app.js"&gt;&lt;/script&gt;
  &lt;body&gt;
  &lt;header&gt;
      &lt;li&gt;&lt;a href="#/"&gt;&lt;i&gt;&lt;/i&gt;first&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#/second"&gt;&lt;i&gt;&lt;/i&gt;Second&lt;/a&gt;&lt;/li&gt;
  &lt;/header&gt;
  
      &lt;div class = "container"&gt;
  
  
  
      &lt;div ng-view&gt; 
  
                  &lt;/div&gt;
  
          &lt;/body&gt;     
  </code></pre>
  
  <p>main.html</p>
  
  <pre><code>&lt;h1&gt; this is main &lt;/h1&gt;
  </code></pre>
  
  <p>second.html</p>
  
  <pre><code> &lt;h1&gt; this is second &lt;/h1&gt;
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>var myApp = angular.module('myApp',['ngRoute']);
  
  myApp.config(function ($routeProvider){
  
  $routeProvider
  
  .when('/',{
      templateUrl: 'pages/main.html',
      controller: 'mainController',
  })
  
  .when('/second',{
      templateUrl: 'pages/second.html',
      controller: 'secondController',
  })
  
     });
  
       myApp.controller('mainController',
         ['$scope','$log','$location',function($scope,$log,$location){
  
          $log.info($location.path());
          console.log("first");
  
    }]);
  
     myApp.controller('secondController',
         ['$scope','$log','$location',function($scope,$log,$location){
  
          $log.info($location.path());
          console.log("second");
  
    }]);
  </code></pre>