Reputation: 451
I've recently been asked to try and fix an app built in angularjs to work in IE7. The main issue seems to be retrieving data from the server.
The following example code works on all browsers > IE7
$scope.getEntity = function (id, callback) {
$http.get('/views/entities/' + id).
success(function(data) {
$scope.entity = data;
callback();
}).
error(function(data) {
$window.location.href = '/error';
});
};
When this fires in IE7 it always ends up throwing an error with an undefined data parameter and redirects to the error page.
Any ideas why this would be happening? It's only isolated to IE7 as it works fine in all other browsers.
Upvotes: 0
Views: 49
Reputation: 222750
As 1.2.x manual says,
To make your Angular application work on IE please make sure that:
You polyfill JSON.stringify for IE7 and below. You can use JSON2 or JSON3 polyfills for this.
Polyfills may be missed in the places where JSON
methods should be obviously called (like JSON AJAX requests).
Upvotes: 1