That particular ng-if checks if the index modulo 3 == 0, which means if the
index is divisible by three. So that'd be items 0, 3, 6, 9, etc.

What you want is a limitTo filter like this: ng-repeat="potato in garden |
limitTo:3"

e


On Tue, Jun 17, 2014 at 3:46 PM, Daniel D <[email protected]> wrote:

> Hey guys,
>
> Quick question. How can I use ng-repeat but only show the first 3 items? I
> tried using this: ng-if="$index % 3 == 0" but I'm not getting the results
> I wanted. Where did I go wrong there? Thanks for your help.
>
> --
> 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.
>

-- 
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.

Reply via email to