angular2的ngfor ngif指令嵌套

原创
2017/03/30 21:53
阅读数 671

ng2 结构指令不能直接嵌套使用,可使用<ng-container>标签来包裹指令

示例如下:

<ul>
<ng-container *ngFor="let item of lists">
<div class="thumb p-date" *ngIf="item.picurl">
<a href="# "><img src="{{item.picurl}} " alt=" " style="width:79px;height: 70px; "></a>
</div>
</ng-container>
</ul>
展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
0 收藏
0
分享
返回顶部
顶部