Only show first element of ng-repeat

后端 未结 4 1933
星月不相逢
星月不相逢 2020-12-31 09:58

How do I show only the first element in angular?

I\'m using ng-repeat like this:

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-31 10:37

    Don't use ng-repeat directive, this should work:

    {{ products[0].price }}

提交回复
热议问题