Skip to content

IE compatibility .query() issue #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tomagladiator opened this issue Nov 27, 2012 · 13 comments
Closed

IE compatibility .query() issue #1

tomagladiator opened this issue Nov 27, 2012 · 13 comments

Comments

@tomagladiator
Copy link

Hello,

I built an app but it doesn't works for IE. :/
And it seems to be about this line in my controller:

$scope.project = Project.query();

Without "query()" IE works but with "query()"... nope.

Do you have an idea? If you want I can create a jsFiddle

thanks
Thomas

@pkozlowski-opensource
Copy link
Owner

@tomagladiator yep, a jsFiddle would help here. The thing that in this project I'm not doing anything with the .query method so a bit surprised... Anyway, send a jsFiddle and I will have a look.

BTW: you might want to check the which is a more recent and promise-based version of this one:
https://github.com/pkozlowski-opensource/angularjs-mongolab-promise

@pkozlowski-opensource
Copy link
Owner

Other question: what is IE version you are using?

@tomagladiator
Copy link
Author

Thanks,
I'm using IE 9...

So, I changed angularjs-mongolab to angularjs-mongolab-promise.
Doesn't works in IE too.

I created a Plunker, but IE don't like it... so I can't test if it works or not... The better thing I can give is the URL of my project : http://constraintsolver.com/lab/16_buffalo/

sorry :/

@pkozlowski-opensource
Copy link
Owner

@tomagladiator Could you please send a plunker anyway? It would really help to narrow it down...

@tomagladiator
Copy link
Author

Of course : http://plnkr.co/edit/uh84Zt

Thanks again.

@pkozlowski-opensource
Copy link
Owner

@tomagladiator OK I can see that IE is going mental after simplifying your plunk. At the moment I've got no idea what is going on. Will look into it later today.

@tomagladiator
Copy link
Author

In the http://docs.angularjs.org/guide/ie :
"Make sure that you polyfill JSON.stringify if necessary (IE7 will need this). You can use JSON2 or JSON3 polyfills for this."

I added json3.js but maybe we need to do something else.

@pkozlowski-opensource
Copy link
Owner

OK, so, re-created a project locally without plunker, routing etc. everything seems to work OK. I've just created a repo with a simple project that actually works OK:

https://github.com/pkozlowski-opensource/mongo-ie-ok

so the mongo adapter doesn't to be the faulty element here...

Unfortunately I don't have much cycles left to help you debug your app and the mongo adapter seems to be working ok so going to close this one. Please reopen if you manage to investigate more and still believe that the issue is in the adapter's code.

@tomagladiator
Copy link
Author

I uploaded mongo-ie-ok here: http://constraintsolver.com/lab/18_test/

Works in Chrome but not in IE, tested with the browser, IETester and an other domain name with an other host...

Could you try again with my link and IE?
Thanks.

@pkozlowski-opensource
Copy link
Owner

Effectively, it doesn't work from your server :-( I'm really not clear what is going on here really.

Could you try 2 things:

  • run this script from a file system (file:// protocol) to see if this works on your end?
  • could you try to do a standard $http request to the MongoLab to see if this is AngularJS or the wrapper?
  • try with the latest AngularJS where the X-Requested-With was removed: http://code.angularjs.org/1.1.1/

@pkozlowski-opensource
Copy link
Owner

@tomagladiator I think I got it - it looks like IE is using a special object for doing CORS requests:

but AngularJS doesn't support it:
angular/angular.js#1047

so your only hope is to remove the X-Requested-With header or simply switch to AngularJS 1.1.1

In short, my understanding is that all the $http CORS requests will fail on IE :-(

@tomagladiator
Copy link
Author

Nice.
I switched to AngularJS 1.1.1 but it's not enough.
Testing in local too.

@pkozlowski-opensource
Copy link
Owner

@tomagladiator so, I think that finally we've managed to narrow down this issue as being linked to AngularJS $http not supporting IE CORS specificities: angular/angular.js#934

I'm going to close this one as I don't think that AngularJS will add IE CORS support (for a good reason). Your only option is to proxy calls to the MongoLab on your server and avoid CORS altogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants