title: How do I call a function in every 10 seconds in Angular 2?
body: <p>How do I call a function in a set Time interval in Angular 2. I want it to be called/Triggered at specific time intervals(for eg 10 secs).
  For Eg:
  ts File</p>
  
  <pre><code>num: number = 0;
  array: number[] = [1,5,2,4,7];
  callFuntionAtIntervals(){
      if(num==5){
          num=0;    
      }
      num++;
  }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div&gt;{{ array[num] }}&lt;/div&gt;
  </code></pre>
  
  <p>So basically the div value will change at intervals</p>