I can't figure out what is the problem in IE11.
App works well without any issue in other browsers like chrome, firefox etc.
Asked
Active
Viewed 1.5k times
10

micronyks
- 54,797
- 15
- 112
- 146
-
What does `document.documentMode` return? Should be 11. – Alexander Feb 16 '16 at 10:21
-
What is that and how to check? – micronyks Feb 16 '16 at 10:22
-
Probably some of https://github.com/angular/angular/search?q=IE11&state=open&type=Issues&utf8=%E2%9C%93 – Günter Zöchbauer Feb 16 '16 at 10:23
-
did you include the es6-shim? – Michael Kang Feb 16 '16 at 10:24
-
@pixelBits - nope. please guide what to do? – micronyks Feb 16 '16 at 10:26
-
1include es6 shim and polyfills: – Michael Kang Feb 16 '16 at 10:36
-
In which file should I include these scripts? in index.html? – Kushan Randima Feb 06 '19 at 00:35
3 Answers
18
You need to include es6-shim
because IE 11 doesn't support Map.prototype.keys
https://github.com/paulmillr/es6-shim
Or you can import directly from cdn:
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.4.1/es5-shim.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.1/es6-shim.js"></script>
Check this related issues:

Ruan Mendes
- 90,375
- 31
- 153
- 217

Joel Almeida
- 7,939
- 5
- 25
- 51
-
This solution fixed this error. But raised new error `The use of a keyword for an identifier is invalid` which still seems open issue @ https://github.com/angular/angular/issues/6501 – micronyks Feb 16 '16 at 10:55
-
in the linked issue, there is a suggested script as a work-around: https://github.com/angular/angular/blob/master/modules/angular2/src/testing/shims_for_IE.js – Michael Kang Feb 16 '16 at 14:26
1
"The use of a keyword for an identifier in invalid" on IE 11 is still an issue for Angular2 beta 6:
http://github.com/angular/angular/issues/6501
In the thread, there is a work-around that seems to work:
// function.name (all IE)
/*! @source http://stackoverflow.com/questions/6903762/function-name-not-supported-in-ie*/
if (!Object.hasOwnProperty('name')) {
Object.defineProperty(Function.prototype, 'name', {
get: function() {
var matches = this.toString().match(/^\s*function\s*(\S[^\(]*)\s*\(/);
var name = matches && matches.length > 1 ? matches[1] : "";
// For better performance only parse once, and then cache the
// result through a new accessor for repeated access.
Object.defineProperty(this, 'name', {value: name});
return name;
}
});
}

Michael Kang
- 52,003
- 16
- 103
- 135