alternative method for ngRepeat

72 views
Skip to first unread message

Sasikumar Veeraiah

unread,
Jan 12, 2015, 6:25:25 AM1/12/15
to ang...@googlegroups.com
Hi all,

Is there any alternative  method/approach available for ngRepeat in angular ?
  
Thanks & Regards,
Sasikumar.V

Sander Elias

unread,
Jan 12, 2015, 6:54:42 AM1/12/15
to ang...@googlegroups.com
Hi Sasikumar,

Yes, you can build your own iterator directive. This is not as simple as it sounds though. What is it you need to do, that you are not getting done with ngRepeat?

Regards
Sander

Sasikumar Veeraiah

unread,
Jan 12, 2015, 8:28:36 AM1/12/15
to ang...@googlegroups.com
Hi Sander Elias,

I done with ngRepeat so far but i red one article about optimizing angular js apps. In that article   "The ng-repeat directive is most likely the worst offender for performance concerns, which means it can easily be abused. An ng-repeat likely deals with Arrays of $scope Objects and this hammers the $digest cycle’s performance."
they told ngRepaet involves no of $watcher method to $digest through our application. So i'm looking for an alternate option for ngRepat if  possible.

As u said it is possible by building our  own directive can u give me some sample code for that so that i can able to understand easily.



Thanks & Regards,
Sasikumar.V

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Sander Elias

unread,
Jan 12, 2015, 1:32:12 PM1/12/15
to ang...@googlegroups.com
Hi Sasikumar,

Well, you can look into the source of ngRepeat itself. Sure you can create a simple iterator yourself, but then again, if you want to keep it in sync with your data, you need to watch the data. It might pay of if you have a really large table you have to show, but in my opinion large tables are usually a bad user interface. Science shows us that more then 150 to 200 elements in a UI only add confusion to the user.  

All in all, I would not bother unless you really can't avoid it. 

Regards
Sander

Reply all
Reply to author
Forward
0 new messages