I would like to push the data into the array after a 2 second delay each time.
//working code
$scope.GetData = function(){
DataFactory.GetCategories()
.success(function(data,status){
$scope.TheArray.push(data);
})
}
//This doesnt work. No data is shown in html
$scope.GetData = function(){
DataFactory.GetCategories()
.success(function(data,status){
setTimeout(function() {
$scope.TheArray.push(data);
}, 2000);
})
}
EDIT:
$scope.GetData = function(){
DataFactory.GetCategories()
.success(function(data,status){
$timeout(function () {
$scope.ChatHistory.push(JSON.parse(JSON.parse(data)));
}, 3000);
})
}