solution for stopping the spinning numbers in angular 2

Viewed 79
 happyCustomers = 0;
 followers = 0;
 awardsWinning = 0;
 photosTaken = 0;
 arrayOfImages = [];
 constructor() { }

 ngOnInit() {
   Observable.interval(400).subscribe(x => {
 this.happyCustomers = this.happyCustomers + 1;
  });
   Observable.interval(200).subscribe(x => {
  this.followers = this.followers + 1;
  });
   Observable.interval(700).subscribe(x => {
  this.awardsWinning = this.awardsWinning + 1;
  });
   Observable.interval(300).subscribe(x => {
   this.photosTaken = this.photosTaken + 1;
 });
}

here i am adding + 1 evrytime and it does not stop, when i reach a certain data count it should stop the count.

2 Answers
Related