[英]Embeeded *ngFor in Angular4
Hi i have a problem with embeeded *ngFor loop. 嗨,我在嵌入* ngFor循环时遇到了问题。 I try to make make something like that.
我试图做这样的事情。
<div *ngFor = let console of consoles>
...
...
<li *ngFor = let pad of console.pad>
{{pad}
</li>
...
...
</div>
I tryed to put [innerHtml] data binding and it works but i have to make that second ngFor working because it will work great with my css styling. 我尝试放置[innerHtml]数据绑定,但是它可以工作,但是我必须使第二个ngFor起作用,因为它将与我的CSS样式一起很好地工作。
Thank you in advance. 先感谢您。
PS. PS。 I'm using Angular4
我正在使用Angular4
Do you mean use innerHTML in the {{pad}} location? 您是说在{{pad}}位置使用innerHTML吗? you may try this way if so:
您可以这样尝试:
<div *ngFor = let console of consoles>
...
...
<li *ngFor = let pad of console.pad>
<span [innerHTML] = {{pad}}></span>
</li>
...
...
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.