How to get the size of a filtered (piped) set in angular2

后端 未结 5 1905
盖世英雄少女心
盖世英雄少女心 2020-12-15 17:20

I wrote my own filter pipe as it disappeared in angular2:

import {Pipe, PipeTransform} from \'angular2/core\';

@Pipe({
  name: \'myFilter\'
})
export class          


        
5条回答
  •  盖世英雄少女心
    2020-12-15 17:36

    You still must call the filter a second time but you can use it directly like this :

    {{ (customerData | myFilter:searchTerm)?.length }}
    

提交回复
热议问题