I am working with an array of objects, each having a unique ID.
My goal is to find the index of each object in the array. I am currently using Angular, however, I am restricted from using $index for this particular task.
$scope.getObjectIndex = function(obj) {
var theArray = _.flatten($scope.myObjects);
var index;
//Is there a way to search the array for my object using its ID?
return index;
}
If you have any advice or suggestions, please feel free to share them. Your help would be greatly appreciated.