Here diseaseList is an array .
for(var i=0;i<_list.length;i++)
{
if($scope.diseaseList.indexOf(_list[i].disease) != -1){
_list[i].favorite = true;
}else{
_list[i].favorite = false;
}
}
I want to do somthing like this
if($scope.diseaseList.toLoweCase().indexOf(_list[i].disease.toLoweCase()) != -1){
but it is throwing error as $scope.diseaseList
is an array .I can remove indexOf
and use one more loop but that I dont want to do .Any other option
please suggest.