In Angular, I want to store the last 100 items to display. Currently, I am using an array and inserting items with 'array.push'. If this method is not effective for this scenario, what alternative approach can I take?
Here is a snippet of the code:
$interval(function()
{
$http.get("...")
.success(function(){
for(var index in response.logs)
{
$scope.logs.push(response.logs[index]);
}
})
}, 1000);
<div ng-repeat="log in logs">{{log.time}}: {{log.log}}</div>