Just to add into alread given answers, the following worked for me:
HTML:
<div id="div{{$index+1}}" data-ng-show="val{{$index}}">
Where $index
is the loop index.
Javascript (where value
is the passed parameter to the function and it will be the value of $index
, current loop index):
var variable = "val"+value;
if ($scope[variable] === undefined)
{
$scope[variable] = true;
}else {
$scope[variable] = !$scope[variable];
}