mia fabbrica si presenta come:
'use strict';
angular.module('myApp')
.factory('httpInterceptor',['$q','$location', '$rootScope', function($q, $location, $rootScope){
return {
response: function(response) {
if(response.success === false) {
console.log("Redirecting");
$location.path('/login');
return $q.reject(response);
}
return response || $q.when(response);
}
}
}]);
Sputa il registro, ma non cambia il percorso. Cosa posso fare per farlo accadere?
Domanda correlata: http://stackoverflow.com/questions/25579938/location-path-not-working-from-http-interceptor/ – Sirozha