Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access is Denied on IE11 in AngularJS

Every development pipeline has 2 parts. FIRST to work hard and develop the application. SECOND to work harder and make it compatible with the great arrogant IE.

We have an AngularJS (v1.3.13) application without any server side code developed in Webstorm. We are making REST calls to service. Our application works fine on Chrome and Firefox without any Console errors. However when we try to open the page in IE11 or IE9 (not tried IE10), our page doesn't load. Console suggests we have 2 errors. One of them is Access is Denied on

xhr.open(method, url, true);

in angular.js.

There are number of posts on internet and none seems to be working. This is what I have tried.

  1. Hosting app in IIS with changed Handler Mappings to support Cross Domain calls on an Application pool of .Net v4.0 (as suggested by a Senior)
  2. Tried to disable to cache for HTTP requests.
  3. Adding Domain in trusted site category and also adding locahost/IP to local intranet.
  4. Changing request type to JSONP and trying to add Access-Control-Allow-Origin (with value of *) to headers.
  5. Changing IE settings to allow Cross Domain calls.

Error is still chasing us. Even my colleagues have tried the same on their machines ending up with similar blow. Is there anyone to suggest me something on this.

It may be CORS and I may need to go for xdr (XDomainRequest) but not sure how to use it as error is in angular.js. I am certainly no expert on this so please suggest.

Screen shot of the error: enter image description here

IE shows another error: [$injector:nomod] Module 'ngLocale' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.2.16/$injector/nomod?p0=ngLocale which I am ignoring for now.

Please suggest me something on this. Thanks.

like image 937
Sandy Avatar asked Feb 26 '15 11:02

Sandy


People also ask

Does AngularJS support IE11?

Read this document if you are planning on deploying your AngularJS application on IE. The project currently supports and will attempt to fix bugs for IE9 and above. The continuous integration server runs all unit tests against IE9, IE10, and IE11.

Does Angular 8 support IE11?

Since Angular CLI 8, there is a new feature called Differential Loading. If you updated through the CLI, running ng serve will target ES2015 by default, which IE11 and older browsers do not support.

Why Angular is not working in IE?

To summarize the above link, IE doesn't support lambda arrow / fat arrow functions which are a feature of es6. (This is if polyfills. ts doesn't work for you). Solution: you need to target es5 for it to run in any IE versions, support for this was only introduced in the new Edge Browser by Microsoft.


1 Answers

I switched from 1.3.4 to 1.4.8 and that did the trick. No more Angular Access Denied in I.E. (Microsoft Edge 25 2015). I don't know why.

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-route.js/1.4.8/angular.min.js"></script>
like image 112
user2150902 Avatar answered Oct 01 '22 10:10

user2150902