I am working on an angular app. I have a enum as follows
export class myEnum {
"status1" = 1,
"status2" = 2,
"status3" = 3,
"status4" = 4,
"status5" = 5
}
In my html I have a data coming from api and I am using *ngFor to display it as follows:
<div>*ngFor="let mydata of data"</div>
Now this data will have a status field in integer(can access using {{mydata.status}}) which will match above mentioned enum. In my html I want to pass/match this number and display it as string. Suppose from API if status coming as 4, then I want to have a code in which I pass this value and it should match it in enum and display "status4" on screen. How can I do that?