How to display length of filtered ng-repeat data

前端 未结 8 1374
花落未央
花落未央 2020-11-22 08:11

I have a data array which contains many objects (JSON format). The following can be assumed as the contents of this array:

var data = [
  {
    \"name\": \"         


        
8条回答
  •  眼角桃花
    2020-11-22 08:38

    You can do it with 2 ways. In template and in Controller. In template you can set your filtered array to another variable, then use it like you want. Here is how to do it:

    .... {{ usersList.length | number }}

    If you need examples, see the AngularJs filtered count examples/demos

提交回复
热议问题