The shuffle filter in that fiddle is causing an infinite digest - the common problem with filtering data that returns different data each time. I created a service that accepts a filter with that issue and returns a filter that uses caching to avoid the digest loop. It's simple to use and I've found it to be very helpful.
Here's the service: https://github.com/m59peacemaker/Angular.FilterStabilize Here's my shuffle filter that uses that service: https://github.com/m59peacemaker/Angular.Shuffle On Thursday, March 22, 2012 1:55:20 PM UTC-5, Igor Minar wrote: > > That works too, but it will cause the array to reshuffle every time > angular tries to update the view. > > I suggest that you just do one time shuffle of the array in your > controller. > > /i > > On Thu, Mar 22, 2012 at 8:21 AM, Adam Bender <[email protected] > <javascript:>> wrote: > >> I believe what you want is to make use of a custom filter. Here is a >> fiddle that shows exactly that: http://jsfiddle.net/adambender/b8sxa/ >> >> Note that I borrowed the shuffle algorithm from here: >> http://snippets.dzone.com/posts/show/849 >> >> Hope that helps >> >> -- >> You received this message because you are subscribed to the Google Groups >> "AngularJS" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/angular/-/UUoeq0EuxQAJ. >> >> To post to this group, send email to [email protected] >> <javascript:>. >> To unsubscribe from this group, send email to >> [email protected] <javascript:>. >> For more options, visit this group at >> http://groups.google.com/group/angular?hl=en. >> > > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
