Can't use enum in Angular template because of export type

Discussão em 'Angular' iniciado por Muffin, Janeiro 15, 2025.

  1. Muffin

    Muffin Guest

    I use ng-openapi-gen to generate types from an openapi doc, and am trying to use a generated enum in my Angular application.

    The enum is defined as such:

    export enum DocType {
    Image = 'Image'
    Video = 'Video'
    }


    I an struggling to make this enum available in my component for the template.

    I tried DocType = DocType and several other ways to make it available, but I get the following typescript error everytime:


    'DocType' cannot be used as a value because it was exported using 'export type'. ts(1362)
    ​

    Anyone have an idea on how to solve this?

    Continue reading...

Compartilhe esta Página