I have a site built in AngularJS that has been working brilliantly. Unfortunately, our client requires the use of IE8. Everything seems to work fine in the site on IE8, except for the fact that I'm getting an object doesn't support this property or methodundefined. I spent all afternoon trying to figure out where the issue was, and I seem to have stumbled upon this bit of code, with the conditional of the if statement seemingly causing the issue:
var i = 0, len = $scope.data.length;
for (; i < len; i++)
{
if ($scope.availableFilters.indexOf($scope.data[i].category) == -1)
{
When I log out the variables, $scope.availableFilters
is an empty array, $scope.data.category
is a string, but when I log the indexOf
call, it seems to throw the error, and not display the log I put after the log of the indexOf
call.
Does anyone know why this would be? Is this saying that indexOf
isn't defined? How could that be?