I have been trying to navigate to views using angulateJs ngRoute. I defined first navigation using
$routeProvider.
when('/login', {
templateUrl: 'login.html',
controller: 'loginCtrl'
}).
when('/home', {
templateUrl: 'home.html'
}).
otherwise({
redirectTo: '/login'
});
Now I want to move to page home from loginController. How can I achieve that. every post just saying about navigating from main page only. I tried with
app.controller('loginCtrl', function($scope, $location){
$scope.login = function(){
$location.path('/home');
}
});