title: AngularJs code to navigate to another page in buttonclick
body: <p>AngularJs code to navigate to another page on a button click event. I have catch the button click event but cannot navigate to another page.
  The following is my code:
  HTML file:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  
  &lt;head&gt;
  
  &lt;script src="js/angular.min.js"&gt;&lt;/script&gt;
  
  &lt;script src="js/app/home.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body ng-app="myapp"&gt;
  
      &lt;div ng-controller="TestCtrl"&gt;
  
        &lt;button ng-click="clicked()"&gt;Click me!&lt;/button&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>And the javascript file is:</p>
  
  <pre><code>var VLogin = angular.module('myapp',[]);
  
  VLogin.controller('TestCtrl', ['$scope',function($scope) {
  
      $scope.clicked = function(){   
  
          $location.path('/test.html');
      }
  
  }]);
  </code></pre>