title: how to add parameter to the function in angular interval
body: <p>I'm writing a function which will iterate through an array with some time interval.</p>
  
  <pre><code>eg:arr=[1,2,3,4,5,6,7]
  </code></pre>
  
  <p>And I want to show each element with angular interval. </p>
  
  <pre><code>$interval(step,5000,7);
  function step(i){
      console.log(arr[i]);
  }
  </code></pre>
  
  <p>So it'll output the numbers inside the array in a 5 seconds' interval. How can I pass the parameter into the function? Thanks.</p>