I'm trying to divide the list into 2 column to display a list when loop. I'm not sure how it should be done. I have already loop my list with a index but it is currently looping in a way from top to bottom in 1 director. How do I loop it like this as below:
1 7
2 8
3 9
4 10
5 11
6 12
My code below:
<--html-->
<ion-content padding>
<ion-row class="heat-row">
<ion-col *ngFor="let heatUp of heatUps; let i = index">
<ion-item>
{{ heatUp.id }}
<button ion-button large>
{{ heatUp.item }}<ion-icon [name]="fireIcon"></ion-icon>
</button>
</ion-item>
</ion-col>
</ion-row>
</ion-content>
Typescript
<-- ts -->
export class QueuePage {
heatUps: any[];
fireIcon: string = "flame";
constructor() {
}
// displayHeatUps(heatUp) {
// console.log(heatUp.text);
// }
ionViewDidLoad() {
console.log('ionViewDidLoad QueuePage');
this.heatUps = []
for(let i = 1; i < 7; i++) {
this.heatUps.push({
item: 'Stop',
id: i
});
}
}
}
please advise thanks.