springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-18 12:15:17
71
假设我有一个围绕NGIF语句
的NGFOR循环<ng-container *ngFor="let item of items">
<ng-container *ngIf="condition1">
//display table1
</ng-container>
</ng-container>
现在,假设我有第二个表(称为表2),如果表1没有显示,我就想显示它。
<ng-container *ngIf="condition1 was never met and table1 is not displayed">
//display table2
<ng-container>
最好的方法是什么?有没有一种方法可以使用Angular的数据绑定功能来做到这一点?或者,你能给我指出正确的方向吗?
顺晟科技:
您可以使用ng-template
和ngif-else<ng-container
*ngIf="condition1; then table1; else table2">
</ng-container>
<ng-template #table1>
<div>
table1
</div>
</ng-template>
<ng-template #table2>
<div>
table2
</div>
</ng-template>
或<ng-container *ngFor="let item of items">
<ng-container *ngIf="condition1;else table2">
//display table1
</ng-container>
</ng-container>
<ng-template #table2> //display table2 </ng-template>
您可以使用标准的角度NGIF,否则像这样
<代码><;NG-容器*NGIF=";条件1;然后是表1;否则表2";>;<;/NG-容器>;<;NG-Template#表格1>;<;细分(>;)表1<;/DIV>;<;/NG-模板>;<;NG-Template#表格2>;<;细分(>;)表2<;/DIV>;<;/NG-模板>;
你可以在这篇文章
中了解更多。05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11