I am facing an issue where I receive a string value as a parameter in a component, but I want to restrict the possible values that can be passed as a parameter, similar to using an enum
.
Currently, I have:
@Input() type: string = '';
However, any value can be assigned to the type
property within the component. I need to limit this to just 3 specific options, similar to how an Enum
works.