ngFor length in Angular 5

后端 未结 1 806
南笙
南笙 2020-12-12 05:25

I have three buttons :

All (Reals+ Fakes), Reals(total count), Fakes(total count)

I am trying to get the total count of my total feeds which will be shown in

相关标签:
1条回答
  • 2020-12-12 05:45

    As per your comments, to retrieve the count of Feed_A and Feed_B, you can make use of Array#filter and Array#length:

    const feedACount = feeds.filter(feed => feed.feed_type !== '').length;
    const feedBCount = feeds.length - feedACount;
    
    0 讨论(0)
提交回复
热议问题