Is there a way to improve this code? I'd like to use the enum type PaymentMethoddirectly in the angular template without renaming it to _PaymentMethod.

export enum PaymentMethod {

export class PaymentComponent {
    // ReSharper disable once InconsistentNaming
    _PaymentMethod = PaymentMethod;

    paymentMethod: PaymentMethod;

<ng-template *ngIf="paymentMethod == _PaymentMethod.CreditCard">
   Enter your card details

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.