IE 11 AngularJS error - Object doesn't support property or method 'from'

拜拜、爱过 提交于 2019-12-01 05:26:29

As Array.from method is not supported by IE, you can try to use:

[].slice.call(document.getElementsByTagName('span')).forEach(function(v) {});

This doesn't require usage of any 3rd party libraries.

You could use an ES2015 polyfill, like es6-shim, Array.from or Babel polyfill

As explained by Mozilla here, the Array.from function is not yet supported by IE

you can use instead _underscore.js with function _.toArray(document.getElementsByTagName('span'))...

FYI:

'Array.from' not supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Not supported in Windows 8.1.

source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!