第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

如何將多ngif應(yīng)用于表格上的數(shù)據(jù)顯示?

如何將多ngif應(yīng)用于表格上的數(shù)據(jù)顯示?

江戶川亂折騰 2022-08-27 09:37:31
如何將多 *ngIf 應(yīng)用于返回到表的數(shù)據(jù)?我需要根據(jù)多條件*ngIf控制列名,但我不知道使用了哪個(gè)標(biāo)簽以及在哪里:*ngIf="coln=repcon.fieldName && repcon.columnType=1" then display data as icon link on field onlineurl*ngIf="coln=repcon.fieldName && repcon.columnType=2" then make it as hidden field to field onlineurl我在angular 7應(yīng)用程序上工作,我顯示動(dòng)態(tài)數(shù)據(jù)沒(méi)有固定的標(biāo)題或內(nèi)容 <thead >                  <tr>                    <th  *ngFor="let coln of headerCols">                        {{coln}}                    </th>                  </tr>                </thead> <tbody>                  <ng-container *ngFor="let repcon of ReportControl">                  <ng-container *ngFor="let repdata of ReportData">                    <tr *ngFor="let rep of reportdetailslist">                      <td *ngFor="let coln of headerCols">                        <span>{{rep[coln]}}</span>                   // i think here can applied multi ng if but which tag used .                        </td>                    </tr>                  </ng-container>                </ng-container>                </tbody>sample dataReportId   onlineurl          reportdate1222       localhost:5000/    12-12-20181222       localhost:7000/    12-01-20191222       localhost:9000/    12-12-2020control reportreportid  fieldname   columntype1222       onlineurl     1
查看完整描述

1 回答

?
幕布斯6054654

TA貢獻(xiàn)1876條經(jīng)驗(yàn) 獲得超7個(gè)贊

根據(jù)您的條件,您可以嵌套 *ngIf :


<td *ngFor="let coln of headerCols">

    <div *ngIf="coln=repcon.fieldName">


        <div *ngIf="repcon.columnType=1">data as icon link</div>


        <div *ngIf="repcon.columnType=2">hidden field</div>

    </div>

</td>

或者用 *ngSwitch :


<td *ngFor="let coln of headerCols">

    <div *ngIf="coln=repcon.fieldName" [ngSwitch]="repcon.fieldName">


        <div *ngSwitchCase="1">data as icon link</div>


        <div *ngSwitchCase="2">hidden field</div>


    </div>

</td>


查看完整回答
反對(duì) 回復(fù) 2022-08-27
  • 1 回答
  • 0 關(guān)注
  • 96 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)