Is there a way to improve this code? I'd like to use the enum type PaymentMethod
directly in the angular template without renaming it to _PaymentMethod
.
export enum PaymentMethod {
CreditCard,
EFT
}
@Component()
export class PaymentComponent {
// ReSharper disable once InconsistentNaming
_PaymentMethod = PaymentMethod;
paymentMethod: PaymentMethod;
}
<ng-template *ngIf="paymentMethod == _PaymentMethod.CreditCard">
Enter your card details
</ng-template>