I have added a custom Array.prototype.functionName to my js file. I am using AngularJS 1.2.3 and when I call $resource to return a query, it appends that custom function in the response array. when i iterate over the response array, it return exceptions when parsing the custom function, that is what i believe. Can anyone suggest me how to work around this problem
Array.prototype.functionName = function(){
//sorting
}
I call my $resource like this in my service
return $resource('/url',{},{
'List':{
method: 'GET',
isArray: true
}
});
and call it in my controller
returnResource.List().$promise.then(function(Data){
console.log(Data); //Data has my custom function append at the end
for(var i in Data){
//do something
}
});