简体   繁体   中英

Embeeded *ngFor in Angular4

Hi i have a problem with embeeded *ngFor loop. 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.

Thank you in advance.

PS. I'm using Angular4

Do you mean use innerHTML in the {{pad}} location? 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM