I have a problem with my angular app in Internet Explorer. It works everywhere without problems (Chrome, Mozilla, Edge), but is included in IE.
I analyzed with Explorer Explorer where the error occurred, and it returned that the error occurs on the following line:
myDataSet[index - 1].data = Array.from(tmp);
If this is the following error message I get:
Object does not support property or method from at Anonymous function....(etc.)
What I am doing is that I have Set()
named tmp
, which contains the following data:
Subsequently, I simply create a simple array object from this Set
.
How can I solve this problem?
EDIT
Based on the recommendations, I added the following code to my application:
if (!Array.from) { Array.from = (function () { var toStr = Object.prototype.toString; var isCallable = function (fn) { return typeof fn === 'function' || toStr.call(fn) === '[object Function]'; }; var toInteger = function (value) { var number = Number(value); if (isNaN(number)) { return 0; } if (number === 0 || !isFinite(number)) { return number; } return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number)); }; var maxSafeInteger = Math.pow(2, 53) - 1; var toLength = function (value) { var len = toInteger(value); return Math.min(Math.max(len, 0), maxSafeInteger); };
javascript arrays angularjs internet-explorer
Robert J. Apr 23 '16 at 12:40 2016-04-23 12:40
source share