{
"employees" : [
{
"name" : "XXX",
"id" : "1",
"Salary" : [
{
"Month" : "XXXX",
"Amount" : "XXXX",
},
{
"Month" : "XXXX",
"Amount" : "XXXX",
},
{
"Month" : "XXXX",
"Amount" : "XXXX",
}
]
},
{
"name" : "YYY",
"id" : "2",
"Salary" : [
{
"Month" : "YYYY",
"Amount" : "YYYY",
},
{
"Month" : "YYYY",
"Amount" : "YYYY",
},
{
"Month" : "YYYY",
"Amount" : "YYYY",
}
]
}
],
}
I encountered an interesting challenge while trying to display this data from the object above in my HTML using AngularJS. Here's what I came up with:
<div ng-repeat="i in vm.employees">
{{i.id}}
{{i.name}}
<ul>
<li ng-repeat="salary in i.Salary">
{{salary.Month}}: {{salary.Amount}}
</li>
</ul>
</div>
With this code snippet, I was able to successfully display the employees' ids, names, and their corresponding salaries. Feel free to use and modify this code as needed for your project!