Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
124
rated 0 times [  126] [ 2]  / answers: 1 / hits: 7750  / 10 Years ago, mon, july 21, 2014, 12:00:00

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);
});

More From » angularjs

 Answers
1

What you need is $interval, have a look here.


[#43732] Sunday, July 20, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
isham

Total Points: 69
Total Questions: 86
Total Answers: 86

Location: Anguilla
Member since Sun, Jan 29, 2023
1 Year ago
;