I am trying to output the result from the success function as following, but am having no luck. The code does return values for UpcomingEvents and if I output that to the html, it works, but when I am passing it onto the returnlist, it does not work.
$scope.Events = {}
$scope.returnlist = {};
var PriorID = 67;
var i = 0;
var j = 0;
//I am calling http get url function which is working fine.
.success(function (response) {
console.log(response);
$scope.Events = response;
//I am able to display Events[0].ID in html.
if ($scope.Events[0].ID == PriorID)
//The condition holds true, so it will go inside the loop. I have
confirmed that with a debugger.
{
newID = $scope.Events[0].ID;
newname = $scope.Events[0].Title;
$scope.returnlist[0] = [{ ID: newID, Name: newname }];
$scope.returnlist[1] = [{ ID: newID, Name: newname }];
//through debugger breakpoints, I have found that returnlist is
getting the correct values.
}
})
Everything works well until I try to display the values in my html. I am trying it like this.
{{returnlist[0].ID}}
I have even tried it like this:
<tr ng-repeat="data in returnlist">
<td>returnlist.ID</td>
but no luck. What am I doing wrong?
Thanks.