ng2 结构指令不能直接嵌套使用,可使用标签来包裹指令
示例如下
<ul>
<ng-container *ngFor="let item of lists">
<div class="thumb p-date" *ngIf="item.picurl">
<a href="# " rel="external nofollow" ><img src="{{item.picurl}} " alt=" " style="width:79px;height: 70px; "></a>
</div>
</ng-container>
</ul>:
以上这篇对angular2中的ngfor和ngif指令嵌套实例讲解就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持靠谱客。
最后
以上就是爱笑小伙最近收集整理的关于对angular2中的ngfor和ngif指令嵌套实例讲解的全部内容,更多相关对angular2中内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复