I'm trying to catch response status of GET call but it's doesn't work
$http({
url: conf.url + 'page/' + $rootScope.name,
method: "GET"
})
.then(function(response) { //200-299 status works correctly
$rootScope.passwrd = response.data.password;
location.href = '#/page';
},
function(response) { //500 status: response = SyntaxError: Unexpected token F at Object.parse (native) at fromJson
if (response.status == 500) { //response.status = underfined
alert('Server error')
} else {
alert('Other error');
}
});