My angular2 application throws exception stating Object doesn't support this action only in Microsoft edge. Please check the below image:
I debugged and found out that the exception is thrown at promise then code. To be more specific, I am getting the error at then on below code:
this.dataLayerService
.postLogin(this.model, this.postURL)
.then(usermasterResponse => this.setToken(usermasterResponse))
.catch(error => {
this.toastCommunicationService.setMessage(error, "",
this.toastCommunicationService.errorType)
});
I have also added below script in the index.html file, but it was also in vain.
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.1/es6-shim.js"></script>
Any help would be highly appreciated.
Thanks in advance.
The issue was with the EventSource in the below code:
I got it resolved by adding Event Source Polyfill js. I followed this EventSource Polyfill link to install the js.
Thanks everyone for the help.
Find your
polyfills.ts
file in your angular project folder and import following lines:If you are using web-animations, so you need this:
For evergreen browsers your need this:
Evergreen browsers definition (original):
The latest versions of Chrome, Firefox, Internet Explorer, and Safari are evergreen browsers, i.e. they automatically update themselves silently without prompting the user. For Internet Explorer, most people consider this to mean IE10+.
Put
<meta http-equiv="x-ua-compatible" content="ie=edge">
in your index.html And also check your polyfills script and import all core-js/es6/ scripts