When attempting to organize three instances of app-story-preview
within a wrapper div using a ngFor
loop, I encountered the following code:
<ng-template [ngIf]="stories.length > 0" [ngIfElse]="empty">
<cdk-virtual-scroll-viewport [itemSize]="itemSize | async" (scrolledIndexChange)="nextBatch()">
<ng-container *cdkVirtualFor="let story of stories; let i = index; trackBy:trackById">
<div class="inner-wrap" *ngIf="(i+1) % 3 !== 1">
<app-story-preview class="fade-in-animation" [layout]="layout | async" [item]="story"></app-story-preview>
</div>
</ng-container>
</cdk-virtual-scroll-viewport>
</ng-template>
Despite my belief that this code would group three instances of app-story-preview
within the div.inner-wrap
, only one instance seems to be included. Can anyone pinpoint what I am doing incorrectly?