Is it possible to call a function at specific time intervals in Angular 2? I want the function to be triggered every 10 seconds. For example:
num: number = 0;
array: number[] = [1,5,2,4,7];
callFuntionAtIntervals(){
if(num==5){
num=0;
}
num++;
}
HTML:
<div>{{ array[num] }}</div>
Essentially, the div value will change at set intervals.