Parsing Array of Objects using Angular JS
This code shows how to use Angular JS to parse array of objects. It needs to use ‘data-ng-repeat’ directive to iterate the arrays. It shows the array of objects into TAU ListView. For this, angular library must be added in your project along with TAU library.
//Index.html
<div class="ui-content" data-ng-controller="myCtrl">
<ul class="ui-listview">
<li class="ui-li-static" data-ng-repeat="country in CountryList">
{{country.Name}}
</li>
</ul>
</div>
//demoController.js
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.CountryList = [
{
"code": "1",
"Name" : "South Korea"
},
{
"code": "2",
"Name" : "USA"
},
{
"code": "3",
"Name" : "UK"
},
{
"code": "4",
"Name" : "Russia"
}
];
});