How to find the count of items in an ngFor after the pipes have been applied

前端 未结 9 1685
面向向阳花
面向向阳花 2020-12-06 04:18

I have an ngFor creating rows in a table that is both filtered and paged.



        
9条回答
  •  悲&欢浪女
    2020-12-06 05:16

    One way is to use template variables with @ViewChildren()

    
    
    @ViewChildren('myVar') createdItems;
    
    ngAfterViewInit() {
      console.log(this.createdItems.toArray().length);
    }
    

提交回复
热议问题