I am saving the numeric value of an enum in my database and returning it to the UI in a different area. Now I want to extract the string value associated with that numeric value in the enum in a different angular component.
I have an enum like so:
export enum ReportedResourceStatusEnum {
New = 1,
Reviewed = 2,
Escalated = 3,
Resolved = 4
}
That value (the 1, 2, 3, 4) is stored as a string property (nvarchar) in the table. When I call the api, an object is returned like this:
{
something: 'Something',
status: '1'
}
When I display to the UI, the '1' is displayed. How do I inject the Enum class and extract the string associated with the value of 1. In this case, being the word New.