I have a list of jobs that I want to display within <ion-row>
. Each row can contain a maximum of two jobs. Each job is wrapped within a <ion-col>
tag.
<ion-row>
<ion-col width-50 class="job-item">Job A</ion-col>
<ion-col width-50 class="job-item">Job B</ion-col>
</ion-row>
I need to be able to loop through the jobs:
<ion-row>
<ion-col *ngFor="let job of jobs" width-50 class="job-item">{{ job.name }}</ion-col>
</ion-row>
But the problem with this is that all the jobs show within the same <ion-row>
tag.
Instead I need something like this pseudo code:
<ion-row>
<ion-col>1</ion-col>
<ion-col>2</ion-col>
</ion-row>
<ion-row>
<ion-col>3</ion-col>
<ion-col>4</ion-col>
</ion-row>
<ion-row>
<ion-col>5</ion-col>
<ion-col>6</ion-col>
</ion-row>
<ion-row>
<ion-col>7</ion-col>
</ion-row>
How can I achieve this? Presumably making use of odd/even numbers?