angular.js - How to control the number of ngrepeat outputs
过去多啦不再A梦
过去多啦不再A梦 2017-05-15 17:03:34
0
3
506

Use $http to get a lot of data from the background, but I only want to repeat 10 items on the page. Is there a controlled number of filters in ngrepeat? How should I write it?

过去多啦不再A梦
过去多啦不再A梦

reply all(3)
phpcn_u1582

Read the documentation carefully, you will always gain something:

limitTo : 10Absolutely suitable for you

世界只因有你

http://docs.ngnice.com/api/ng/filter/limitTo

大家讲道理

If you want to loop the last 3, you can write like this

limitTo : -3
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template