mat-list in angular 5

Discussão em 'Angular' iniciado por crista, Janeiro 3, 2025.

  1. crista

    crista Guest

    I have a question about implement mat-list in angular 5.

    I had this code, when I had the divider insede the mat-list-item but the divider line didn't show always


    <mat-list >
    <mat-list-item class="pathitem" *ngFor="let item of Lst" style="height: 76px;">
    <div>
    <h3>item.title</h3>
    <p>item.desc</p>
    <p>item.ad</p>
    </div>
    <mat-divider class="background-divider"></mat-divider>
    </mat-list-item>
    </mat-list>

    then I change that for this:


    <mat-list *ngFor="let item of LstTramosFiltro" >
    <mat-list-item class="pathitem" style="height: 76px;">
    <div>
    <h3>item.title</h3>
    <p>item.desc</p>
    <p>item.ad</p>
    </div>
    </mat-list-item>
    <mat-divider class="background-divider"></mat-divider>
    </mat-list>

    My question is which of the two is the correct solution if you use ngfor in mat-list or use in mat-list-item; and where the use of the mat-divider is correct

    thanks for your help.

    Continue reading...

Compartilhe esta Página