title: How to run function with parameters using $timeout in AngularJS?
body: <p>I have this function inside my AngularJS controller. It looks like this;</p>
  
  <pre><code>polling_interval=1000;
  var poll = function() 
  {
    //Execution code
    $timeout(poll, polling_interval); 
  }; 
  poll();
  </code></pre>
  
  <p>It uses the <code>$timeout</code> service in AngularJS to keep calling itself. This works until I wanted to add parameters to this poll function. My code looks like this for the parameters added;</p>
  
  <pre><code>polling_interval=1000;
  var poll = function(param1, param2) 
  {
    //Execution code
    $timeout(poll(param1, param2), polling_interval); 
  }; 
  poll(param1, param2);
  </code></pre>
  
  <p>The syntax was not acceptable and I am at a loss now. How do I execute the function with parameters using <code>$timeout</code> in AngularJS? If this cannot be done, are there work-arounds to this problem? I would like to have my poll function accept parameters.</p>