I have a login form and I am simply trying to change the path once the register button is selected. For some reason the login button works but the register button does not. When I click it nothing happens. Even if I put an alert inside the register controller nothing comes up which tells me that the controller function is not being executed. I am new to angular js and not sure if I understand ng-click and $location.path well
here is my code for the register button:
<button ng-click="register()" class="btn btn-default" id="lefty" >Register</button>
and my code for the controller and the route provider in app.js:
$routeProvider.when('/register', {
templateUrl: 'app/partials/register.html',
controller: 'RegisterController'
});
app.controller('RegisterController', function($scope, $location) {
$scope.register = function() {
$location.path('/register');
}
});
I simply expect once register button is clicked to be able to go to the /register path.