I'm facing some performance issue with ng-repeat and 1000+ <tr>
some googling tells me that I have to roll my own directive to overcome $digest cycle. I don't understand what should I do about that? Can somebody please explain this and how can I improve the performance. I have to show all the 1000+ rows that's the requirement and right now it takes almost 20s to create the entire table.
Thanks very much.
<tr ng-repeat="obj in objs" id="obj{{obj.id}}" ng-show="displayObj(obj)">
<td>{{obj.objId}}</td>
<td style="min-width: 70px;">
<textarea rows="3" style="width: 100px" name="text" maxlength="100" ng-model="obj.text"></textarea>
</td>
<td><button class="btn btn-primary" ng-click="saveObj($event, obj)">Update</button></td>
</tr>
In Controller
$scope.saveObj = function ($event, obj) {
console.log(deal);
var UpdateObj = ObjService.updateObj();
var updateObj = new UpdateObj();
updateObj.text = obj.text;
updateObj.$update({objId: obj.id});
};
Now I realised that the performance issue comes from $apply which I have around 3000 elements. if I take ng-model off, the performance is better. But I would lose two-way data binding. Is there anyway I could tune the performance here?