Cast int to enum strings in Typescript

前端 未结 3 1485
-上瘾入骨i
-上瘾入骨i 2020-12-14 05:39

I get from a RESTful Service the following data:

[
  {
    \"id\": 42,
    \"type\": 0,
    \"name\": \"Piety was here\",
    \"description\": \"Bacon is tas         


        
3条回答
  •  自闭症患者
    2020-12-14 06:20

    I think with

    {{message.type}}
    

    you just get the mapped value and not the enum. Please try following code.

    {{TYPE[message.type]}}
    

提交回复
热议问题