HTML + Ionic 3.x: How to use a for loop in the html file using in instead of of

♀尐吖头ヾ 提交于 2019-12-06 09:15:42

You last is the best yet, but here is an other way

TS

for(let i=0; i < n; i++){ // n is array.length
   this.globalArray.push({ a1 : array1[i] , a2 : array2[i] , a3 : array3[i] });
}

HTML

<ion-item *ngFor="let item of globalArray;">
  {{item.a1}} {{item.a1}} {{item.a1}}
</ion-item>

This is pretty simple

    <ul>
    <li *ngFor="let item of array1">{{item.property}}<li>
    <ul>
   <ul>
    <li *ngFor="let item of array2">{{item.property}}<li>
    <ul>
   <ul>
    <li *ngFor="let item of array3">{{item.property}}<li>
   <ul>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!