5

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);
    });
1
  • 8
    That's because you're confusing $timeout with $interval Commented Jul 21, 2014 at 12:27

1 Answer 1

11

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.