I am currently working on pushing JSON data into the scope to add to a list without reloading the page. I am using the Ionic framework and infinite scroll feature.
Can someone please point out what I am doing wrong and help me figure out how to append new items to the end of the list?
Thank you for any guidance.
Example JSON array:
var fakeListData = [
{ "DATE" : testDateTimeFormated,
"NUMBER_OF_ALL_CALLS" : 25,
"RESULT_DONE" : 0,
"RESULT_NOT_INTERESTED" : 0,
"RESULT_NO_APP" : 0
},
{ "DATE" : testDateTimeFormated,
"NUMBER_OF_ALL_CALLS" : 0,
"RESULT_DONE" : 0,
"RESULT_NOT_INTERESTED" : 0,
"RESULT_NO_APP" : 0
}];
Fill List Items:
// Option one (throws Chrome sendrequest error: TypeError: Converting circular structure to JSON)
$scope.listData.push(fakeListData);
// Option two (crashes browser)
angular.forEach(fakeListData,function(item) {
$scope.listData.push(item);
});