bin*_*ars 4 ionic-framework angular
我正在使用此代码显示多个位置:
<div class="location" *ngFor="let item of location_array">
{{item}} <hr>
</div>
Run Code Online (Sandbox Code Playgroud)
这导致所有位置,由水平规则分隔.我如何编辑它以获得完全相同的结果,但没有最后的水平规则?
Fai*_*sal 12
使用last由提供*ngFor随*ngIf您<hr>:
<div class="location" *ngFor="let item of location_array; let lastItem = last;">
{{item}} <hr *ngIf="!lastItem">
</div>
Run Code Online (Sandbox Code Playgroud)
这是一个StackBlitz演示.
| 归档时间: |
|
| 查看次数: |
2246 次 |
| 最近记录: |