0

I have created an angularjs application which uses $resource, here UserType.customDelete factory. after executing the server will return either [{"0":"T"}] or [{"0":"F"}], The application is working fine in all browser except IE8, in IE8 i am getting [{}] , but in all other browser even in IE9 i am getting [{"0":"T"}]

can anyone please give me some solution for this

UserType.customDelete({
    uid : user.uid,
    action : 'remove'
}, function(data)
    {
     console.log(JSON.stringify(data));
     if(data[0][0] === "T")
     {
       console.log('success');
     }
     else
     {
      console.log('failure');
     }

    }, function(error) {

});

modals.js

angular.module('users', ['ngResource'])

.constant('OPTIONS',
{
    query:
    {
        method: 'GET',
        isArray: true
    },
    customDelete:
    {
        method: 'POST',
        isArray: true
    }
})

.factory('UserType', function($resource, OPTIONS)
{
    return $resource('rest/users/:uid/:action',
    {
        uid: "@uid",
        action: "@action"
    }, OPTIONS);
});
Alex Man
  • 4,746
  • 17
  • 93
  • 178

1 Answers1

0

Delete all the "Console.log" lines. In ie8, console.log is only available after you have opened the Developer Tools.

Same problem here

Community
  • 1
  • 1
Marwen Cherif
  • 560
  • 5
  • 13