Check out this data I have:
{
"statusCode": 200,
"result": {
"items": [
{
"Name": "date",
"Fields": {
"{3C3170EE-E6D5-4075-A864-8AB86D1E8E98}": {
"Name": "Promo Content",
"Value": "September 22, 2015"
}
}
},
{
"Name": "rate",
"Fields": {
"{3C3170EE-E6D5-4075-A864-8AB86D1E8E98}": {
"Name": "Promo Content",
"Value": "10%"
}
}
},
{
"Name": "description",
"Fields": {
"{3C3170EE-E6D5-4075-A864-8AB86D1E8E98}": {
"Name": "Promo Content",
"Value": "This rate remains valid as of the date mentioned above."
}
}
}
]
}
}
In addition to that, here's my HTML and JS code:
<body ng-app="myApp">
<div ng-controller="CallWebApi">
<ul>
<li ng-repeat="item in data">
{{ item.Name }}: {{ item.Fields.['{3C3170EE-E6D5-4075-A864-8AB86D1E8E98}'].Value }}
</li>
</ul>
</div>
<script>
angular.module('myApp',[]).controller('CallWebApi', function($scope,$http) {
$http.get('./test.js').
success(function (response) {
$scope.data = response.result.items;
console.log('success ' + response)
})
.error(function(response) {
console.log('failure ' + response)
});
});
</script>
</body>
I am wondering, how can I display the Value within the Fields object?
I anticipate seeing:
- date: September 22, 2015
- rate: 10%
- description: This rate remains valid as of the date mentioned above.