Trying to call one service from angular using $http. Normally the service will return 200 status code. But if the session is our it will return status 302. This I can see in the developer console network tab also. But in code the status code coming as -1
Here is the code
function getData(reqUrl) {
                return $http({
                    method: 'GET',
                    url: reqUrl
                });
            }
function get******(serviceName, callback) {
                getData(DataClient.serverUrl + '/****/services/rest/Q******/*****/' + serviceName)
                    .then(function (res) {
                        if (res.status == -1) {// here we need to check with 302
                            //session out
                        } else {
                           // rest of the code
                        }
What could be the issue? Why angular is giving -1 instead of 302?
 
     
    