How to print list of values which are not in array [] format

扶醉桌前 提交于 2019-12-11 17:38:32

问题


Here is Response from REST API

{name:test,age:25,male:true},{name:test1,age:26,female:true},{name:test3,age:27,male:true}

How to display in front-end

 <div *ngFor="let item of bundle | keyvalue">
    <li>{{item.key}}:{{item.value}}</li>   
 </div>

It printing like

0:{name:test,age:25,male:true}

1:{name:test1,age:26,female:true}

2:{name:test3,age:27,male:true}

and also

 <div *ngFor="let item of bundle">
        <li>{{ item.name}}</li>
        <li> {{item.age}} </li>
   </div>

It is not working

Expecting Result like this

Name: test Age: 25 Male [/]

来源:https://stackoverflow.com/questions/55537734/how-to-print-list-of-values-which-are-not-in-array-format

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!