Reputation: 1
"TypeError: Object doesn´t support this actionundefined" That´s the message in IE8´s console when I try to execute my angular app. And Angular doesn´t execute anything that it should. Anybody would have a tip to solve this issue? I have already included json2 and ui-ieshiv. I have also written html tag in this way:
<html xmlns:ng="http://angularjs.org" class="ng-app:app" ng-app="app" id="ng-app">
All the best!
Upvotes: 0
Views: 3812
Reputation: 1
Problem was solved! I found an issue between IE8 and the plugin Angular-Restful. When I took it away, my app work back again.
Upvotes: 0
Reputation: 3124
There were 3 things that IE8 didn't like when I ran my angular app in it.
1)The console.log function. I had to put this javascript in the page before angular is bootstrapped:
// 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;
}
}
}());
2) The toISOString function
/*IE8 toISOString hack */
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';
};
}
3) The forEach function
/*IE8 hack to support forEach */
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);
}
}
}
Note that I didn't write any of this myself.. I 'mined' it from SO.
These were the culprits that I had to fix in order to run in IE8. Now, it works fine.
Upvotes: 9