i have a AngularJS project with Asp Web API as backend. I have a login controller in angularjs that make a signin request to web api to request a token and if the user correctly logged in i set a variable in angularjs.
Now how can i prevent to load a route if the user isn't logged in? How, in the routeProvider can i prevent to load a route based on the setted variable?
gestionale.config(
function ($routeProvider, $locationProvider) {
$routeProvider.
when('/personale', {
templateUrl: 'View/people.html',
controller: 'mainController',
!!What to put here????!!!
})
});
Thanks