离子列表中的多个* ngFor循环

时间:2018-06-20 21:51:06

标签: angular typescript ionic-framework

我有两个数据数组。 “字幕”和“标题”。如何将两个阵列正确地合并到一个离子列表中,以便在一个离子项目(字幕顶部的标题)中显示两个阵列的标题和副标题?

在我的.ts文件中:

Option Explicit
Public Sub GetInfo()
    Dim IE As Object
    Set IE = CreateObject("InternetExplorer.Application")
    With IE
        .Visible = True
        .navigate "https://factfinder.census.gov/faces/nav/jsf/pages/index.xhtml"

        While .Busy Or .readyState < 4: DoEvents: Wend '<== Loop until loaded

         .document.querySelector("#cfmainsearchform > a").Click

         STOP '<== Delete me later
        'Quit '<== Remember to quit application
    End With
End Sub

在我的.html文件中

items = [
 'Email',
 'Phone Number',
 'Address',
 'Cards'
];

data = [ 
  "first last",
  "test phone number",
  "test address"
]

1 个答案:

答案 0 :(得分:0)

  <button ion-item *ngFor="let item of items; let i = index" (click)="enterPage(item)">
        {{items[i]}}
        <h3>{{data[i]}}</h3>
  </button>