How to Iterate JSON properties in TypeScript

后端 未结 5 2063
慢半拍i
慢半拍i 2020-12-20 06:00

My question is very simple, I have a following JSON Typescript Object and I like to Iterate trought the JSON properties

{\"work_type\":\"Fabricación\",\"work_t

5条回答
  •  生来不讨喜
    2020-12-20 06:06

    You can get all the keys using Object.Keys and assign to a variable as follows,

    this.properties=JSON.parse(this.values);
    let response = Object.keys(this.propertie);
    

    now you can use ngFor over it,

    {{properties[key]}}

提交回复
热议问题