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指令嵌套實例講解就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持武林網。
新聞熱點
疑難解答