I created 2 production applications using AngularJS that work fine in IE8 with just a few javascript fixes.
Firstly, if the developer console is not open, the console.log statement will fail. I fixed it with the following js snippet on the start page where the angular application appears:
// Avoid `console` errors in browsers that lack a console. (function() { var method; var noop = function () {}; var methods = [ 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', 'timeStamp', 'trace', 'warn' ]; var length = methods.length; var console = (window.console = window.console || {}); while (length--) { method = methods[length]; // Only stub undefined methods. if (!console[method]) { console[method] = noop; } } }());
Secondly, I use toISOString to convert date stamps. In IE, this function is not implemented, so I use this snippet:
if (!Date.prototype.toISOString) { Date.prototype.toISOString = function() { function pad(n) { return n < 10 ? '0' + n : n } return this.getUTCFullYear() + '-' + pad(this.getUTCMonth() + 1) + '-' + pad(this.getUTCDate()) + 'T' + pad(this.getUTCHours()) + ':' + pad(this.getUTCMinutes()) + ':' + pad(this.getUTCSeconds()) + '.' + pad(this.getUTCMilliseconds()) + 'Z'; }; }
Thirdly, the forEach method is not supported in IE, so I use this:
if (!Array.prototype.forEach) { Array.prototype.forEach = function(fn, scope) { for(var i = 0, len = this.length; i < len; ++i) { fn.call(scope, this[i], i, this); } } }
All of these code snippets were unloaded from StackOverflow answers and work for me, but YMMV.
I read the angular IE8 documentation and I did not come across the situations described in the documentation. For directives, I use the format: <div directive-name> and everything works fine.