search

Home  >  Q&A  >  body text

angular.js - 如何控制ngrepeat输出的个数

使用$http从后台获取非常多的数据,但是我只想在页面中repeat出10条,请问ngrepeat中是不是有控制数量的filter?应该怎么写呢

过去多啦不再A梦过去多啦不再A梦2744 days ago494

reply all(3)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-15 17:05:34

    Read the documentation carefully, you will always gain something:

    limitTo : 10Absolutely suitable for you

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-15 17:05:34

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

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-15 17:05:34

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

    limitTo : -3

    reply
    0
  • Cancelreply