There is a way, although it's a little rude. Below is the code that needs to be downloaded before angular and your application can run. This is a gasket / polypol assembly, mainly from the Mozilla Developer Network, some of them.
Please note that this allows the launch of AngularJS, but does not update the IE8 JS environment. Therefore, things like somePromise.catch(...) will not work, you should write somePromise["catch"](...) .
if (!Array.prototype.indexOf) { Array.prototype.indexOf = function(searchElement) { if (this.length === 0) { return -1; } var n = 0; if (arguments.length > 1) { n = Number(arguments[1]); if (isNaN(n)) { n = 0; } else if (n !== 0 && n !== Infinity && n !== -Infinity) { n = (n > 0 || -1) * Math.floor(Math.abs(n)); } } if (n >= this.length) { return -1; } var k = n >= 0 ? n : Math.max(this.length - Math.abs(n), 0); while (k < this.length) { if (k in this && this[k] === searchElement) { return k; } ++k; } return -1; }; } if (!Array.prototype.filter) { Array.prototype.filter = function(fun/*, thisArg*/) { if (this === undefined || this === null) { throw new TypeError(); } var t = Object(this); var len = t.length >>> 0; if (typeof fun !== 'function') { throw new TypeError(); } var res = []; var thisArg = arguments.length >= 2 ? arguments[1] : void 0; for (var i = 0; i < len; i++) { if (i in t) { var val = t[i]; if (fun.call(thisArg, val, i, t)) { res.push(val); } } } return res; }; } if (!Array.isArray) { Array.isArray = function(arg) { return Object.prototype.toString.call(arg) === '[object Array]'; }; } if (!Array.prototype.every) { Array.prototype.every = function(callbackfn, thisArg) { 'use strict'; var T, k; if (this == null) { throw new TypeError('this is null or not defined'); } var O = Object(this); var len = O.length >>> 0; if (typeof callbackfn !== 'function') { throw new TypeError(); } if (arguments.length > 1) { T = thisArg; } k = 0; while (k < len) { var kValue; if (k in O) { kValue = O[k]; var testResult = callbackfn.call(T, kValue, k, O); if (!testResult) { return false; } } k++; } return true; }; } if (!Object.create) { Object.create = (function() { var Object = function() {}; return function (prototype) { if (arguments.length > 1) { throw new Error('Second argument not supported'); } if (typeof prototype != 'object') { throw new TypeError('Argument must be an object'); } Object.prototype = prototype; var result = new Object(); Object.prototype = null; return result; }; })(); } if (!Array.prototype.forEach) { Array.prototype.forEach = function(fun /*, thisArg */) { if (this === void 0 || this === null) throw new TypeError(); var t = Object(this); var len = t.length >>> 0; if (typeof fun !== "function") throw new TypeError(); var thisArg = arguments.length >= 2 ? arguments[1] : void 0; for (var i = 0; i < len; ++i) { if (i in t) fun.call(thisArg, t[i], i, t); } }; } if (!String.prototype.trim) { String.prototype.trim = function() { return this.replace(/^\s+|\s+$/gm, ''); }; } (function() {
If you have angular-bootstrap, you also need to βplanβ the angular.min.js file because angular -boostrap uses {in: someCondition} , but due to the older JS in runtime, the keyword is reserved and will not generate the code.
Find: var e=(b?"s":'((l&&l.hasOwnProperty("'+a+'"))?l:s)')+"."+a;
Replace: var e=(b?"s":'((l&&l.hasOwnProperty("'+a+'"))?l:s)')+"['"+a+"']";
source share