Within my product section, there is a total of approximately 300 products. To implement pagination, I have utilized the ngx-pagination plugin. The products need to be displayed based on media query specifications. For example, if the viewport size falls within the range of 1600px to 1200px, the value itemsPerPage:30
should be applied; for sizes between 1199px to 768px, itemsPerPage:24
should be used.
How can this customization be achieved?
<ecom-section-box>
<ecom-card-wc-5 *ngFor="let data of dataArray4 | paginate: { itemsPerPage: 30, currentPage: p }" [data]="data"></ecom-card-wc-5>
</ecom-section-box>
<div class="card card2">
<span class="pagination-alignment">
<pagination-controls (pageChange)="p = $event"></pagination-controls>
</span>
</div>