Angular how to use slicePipe in the new @for loop

Discussão em 'Angular' iniciado por Tony, Dezembro 16, 2024.

  1. Tony

    Tony Guest

    How can you use the slicePipe with the new @for syntax in Angular?

    @Component({
    selector: 'slice-list-pipe',
    template: `
    <ul>
    <li *ngFor="let i of collection | slice : 1 : 3">{{ i }}</li>
    </ul>
    `,
    })
    export class SlicePipeListComponent {
    collection: string[] = ['a', 'b', 'c', 'd'];
    }

    Continue reading...

Compartilhe esta Página