UPDATE
Thne problem is you are losing the refence. You can do that with a single array. You need a array of objects.
You have a nice explanation of this issue here:
Binding inputs to an array of primitives using ngRepeat => uneditable inputs
Then you can try any of the other solutions I propose to you, for example:
$scope.arr = [{value: 'word-y'}, {value:'sd'}, {value:false}, {value:'word-x'}, {value:'word-z'}];
and:
<style type="text/css">
.list-cell {
counter-reset: cell;
}
.cell_iter:before {
counter-increment: cell;
content: "position " counter(cell) ". ";
}
</style>
[..]
<ul class="list-cell">
<li ng-repeat="c in arr track by $index">
<span ng-class="{'cell_iter': c.value !== false}">{{ c.value }}</span>
</li>
</ul>
An example here: https://plnkr.co/edit/z0d27M8otjc16THMUPkA
OLD Reply
The posible solutions:
(Solution 1)In your controller modify the array in order to have the index value:
var newArr = arr.filter(function(value){return value!== false})
(Solution 2) Or in your template:
<div class="cell" ng-repeat="c in arr | filter:filterFn">
And in yout controller:
$scope.filterFn = function(c){ return c !== false}
(Solution 3) The solution that I most like, only css:
<div class="list-cell">
<div class="cell" ng-repeat="c in arr">
<div class="cell_iter" ng-if="c !== false">{{ <someIndex> }}</div>
</div>
</div>
CSS:
.list-cell {
counter-reset: cell;
}
.cell_iter:before {
counter-increment: cell;
content: "position " counter(cell) ". ";
}
(Other solutions) You can play with ng-init in your ng-repeat. Create a new variable... But this solution will be ugly.
UPDATE ADDING NG-INIT:
the idea is to create a new property in the parent context to ng-repeat and inside the ng-repeat another different context.
We will do all this in the template (Ugly):
<ul class="example-animate-container" ng-init="$counterHelper=0">
<li class="animate-repeat" ng-repeat="c in arr track by $index" ng-init="$parent.$counterHelper = c !== false?$counterHelper +1:$counterHelper; p={}; p.value=c; p.$counter = $counterHelper;">
[{{$index + 1}}] [{{ p.$counter }}] {{ p.value }}
</li>
</ul>
here an example: https://plnkr.co/edit/z0d27M8otjc16THMUPkA?p=preview