Angular_10 Angular_10 - 1 month ago 12
JSON Question

How to show json object in jsp using table tags with ng-repeat directive in angularjs

[Object, "EH882932", "E32", "M42", "873590", 125080, "R0136", "S38", "171", "Arrived ", "Arrived (DLR-DEL)", "3", "XXX", Object, Object, 1392681600000]


This is how my json object looks in browser console.Pls help me to show them in jsp using angularjs .The values are dynamic & "object" in json have key , values!

Answer

By using ng-repeat I've resolved this issue.Below code works fine when we have key,value pair objects in the data source and both values we want to display.

<div ng-repeat="(k,v) in dataSource"> 
<p>{{k}}</p>
<p>{{v}}</p>
</div>

If we just want values and keys dont hold any necessity to display then

<div ng-repeat="data in dataSource"> 
    <p>{{data.key}}</p>
</div>
Comments