I have the following, but what I'm trying to do is have the $timeout
loop every 10 seconds, but what the below is doing is running the shuffleArray()
then after 10 seconds it fires it again and that is it. It stops there.
$http.post("/content", {"Data":JSON.stringify($scope.content)}).success(function(data, status, header, config){
$scope.ourcontent = data;
shuffleArray($scope.ourcontent);
$timeout(function() {
shuffleArray($scope.ourcontent);
}, 10000);
});
What you need is $interval, have a look here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With