I have a ng-repeat with multiple ng-show condition inside. Something like this (fictive example):
<ul>
<li ng-repeat="item in items | filter:searchFilter" >
<label ng-show="item.label==1">{{item.label}}</label>
<label ng-show="item.label==2">{{item.label}}</label>
<label ng-show="item.label==3">{{item.label}}</label>
<label ng-show="item.label==4">{{item.label}}</label>
<label ng-show="item.label==5">{{item.label}}</label>
<label ng-show="item.label==1">{{item.label}}</label>
<label ng-show="item.label==2">{{item.label}}</label>
<label ng-show="item.label==1">{{item.label}}</label>
</li>
</ul>
I am using ng-show for formatting purpose, e.g. :
I want to show the cellphone column, when the item.cellphone is not empty...
I have a big data source (+1000 rows) and I have noticed performance problem when I use the filter.
If I remove most of the ng-show conditions, the performance is good. Here's live example :
I know you can improve the performance with a "track by" (here's an topic about it), but it look like it is not enough to make the filter "smooth" (at least, not too laggy).
Is there a way to improve the filter performance of ng-repeat with multiple ng-show condition and a large data source ?