Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 切管前计数的角度6_Angular - Fatal编程技术网

Angular 切管前计数的角度6

Angular 切管前计数的角度6,angular,Angular,我有一个*ngFor,用于定制管道和标准切片管道: <div *ngFor="let offer of offerListData | slice:0:propertyLimit | offerFilter: countyId: cityId as filtered; let i = index; let propCount = count"><p>Offer id = {{offer.Id}}</p></div> offerListData.l

我有一个*ngFor,用于定制管道和标准切片管道:

<div *ngFor="let offer of offerListData | slice:0:propertyLimit | offerFilter: countyId: cityId as filtered; let i = index; let propCount = count"><p>Offer id = {{offer.Id}}</p></div>

offerListData.length?您好@jbnitet,如果我使用offerListData.length,我只得到自定义管道之前的计数否,您没有。offerListData.length是offerListData的长度。切片管道不会修改阵列。它会创建数组的切片副本。您可以保证offerListData不会随切片管道的变化而变化,但在offerFilter管道之后它保持不变,我想让它知道的是offerFilter管道之后的长度,但在切片管道之前,您首先使用切片,然后使用offerFilter管道,那么,您希望在哪一点进行计数?切片后,过滤后的?
<p>Total number of offers: 4</p>
<div *ngFor="let offer of offerListData | slice:0:propertyLimit | offerFilter: countyId: cityId as filtered;">
    <p>Offer id = {{offer.Id}}</p>
</div>
document.getElementById('offerCounter').innerHTML = this.resultFromFilter.length.toString();