When I reference to an enum value I am getting below error.
ERROR TypeError: Cannot read property 'Text' of undefined
Is there any way to use this enum within html part of component?
My Enum;
export enum InputType {
Text = "text",
Number = "number",
Color = "color"
}
My component;
export class AppComponent {
title = 'app';
inputType : InputType;
}
html part;
<app-input [inputType]="inputType.Text"></app-input>
inputType = InputType;. Otherwise,inputTypeis declared as type "InputType" but is never assigned, hence it will be undefined at runtime.