How can I use ngFor to iterate over Typescript Enum as an array of strings

Discussão em 'Angular' iniciado por Rob Gorman, Maio 9, 2025.

  1. Rob Gorman

    Rob Gorman Guest

    I'm using Angular2 and TypeScript and I have an enum:

    export enum Role {
    ServiceAdmin, CompanyAdmin, Foreman, AgentForeman,
    CrewMember, AgentCrewMember, Customer
    }


    I want to use *ngFor to iterate over the enum. What is the best way to do this? Must I create a Pipe? Or is there a simpler way?

    Continue reading...

Compartilhe esta Página