Closed mabotofu closed 10 years ago
This is XDomain. Since its taking control of XMLHttpRequest, Angular just thinks it's still loading. I could detect the timeout and abort the XHR - that way the catch
will actually fire. Will edit this issue and file it as a bug. Not sure when I'll get time for this though...
No worries. I can just wrap the request with a new promise object and force it to reject after a few seconds. Everything else is working fine. XDomain is great. Thank you for your great work!
Glad it's being of use :)
On Wed, Jun 11, 2014 at 2:07 AM, Naomi Suzuki notifications@github.com wrote:
No worries. I can just wrap the request with a new promise object and force it to reject after a few seconds. Everything else is working fine. XDomain is great. Thank you for your great work!
— Reply to this email directly or view it on GitHub https://github.com/jpillora/xdomain/issues/84#issuecomment-45634824.
In the angular example, I've modified the request to:
$http.get('http://echo.jpillora.com/foo/bar/status/500').then(function(result) {
$rootScope.output = result.data;
}).catch(function() {
console.log("error");
}).finally(function() {
console.log("complete");
});
and it correctly prints "error". will close. reopen if it's happening. it could be an angular version issue...
I'm using angularjs and xdomain. Everything is working but when the proxy.html doesn't exist or fails to load, all requests to the domain just hangs and says:
This is fine and expected but the Angular's promise object doesn't resolve or reject so nothing happens.
Example:
After
It will say
Then, no logs will show. It should at least says "error".
If I remove the domain from the xdomain setup, it will go to the catch and finally. Is this a xdomain issue or Angular is doing something weird?
Thank you