I have the following route
$routeProvider
.when('/users/', {
auth: true,
required: ['user_read'],
templateUrl: '/js/app/views/templates/user/users.html',
controller: 'UsersController'
})
In my LoginController, if it is successful login, I'm trying to redirect the user to that path using
$location.path('/users');
I also have a rootScope listener to check for permission
$rootScope.$on('$routeChangeSuccess', function (current) {
console.log($route.current.$route);
}
Why is that last console log only showing
Object
redirectTo: "/users/"
__proto__: Object
when I do the redirect from the controller?
However, if I have a link on the template, it is showing
Object
auth: true
controller: "UsersController"
reloadOnSearch: true
required: Array[1]
templateUrl: "/js/app/views/templates/user/users.html"
__proto__: Object
The bottom output one is how I'm expecting the output to be.
Thanks,
Tee