}
ngOnDestroy() {
- if (this.stats.secondsInterval !== null) {
+ if (this.stats !== null && this.stats.secondsInterval !== null) {
clearInterval(this.interval);
}
}
getStats() {
this.requestService.getStats().subscribe(
stats => {
- console.log(stats);
this.stats = stats;
this.runInterval();
},