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:
<!DOCTYPE html>
<html>
<head>
<script src="js/angular.min.js"></script>
<script src="js/app/home.js"></script>
</head>
<body ng-app="myapp">
<div ng-controller="TestCtrl">
<button ng-click="clicked()">Click me!</button>
</body>
</html>
And the javascript file is:
var VLogin = angular.module('myapp',[]);
VLogin.controller('TestCtrl', ['$scope',function($scope) {
$scope.clicked = function(){
$location.path('/test.html');
}
}]);