2021-12-09 14:24:42 +00:00
|
|
|
import {Component, OnInit} from '@angular/core';
|
|
|
|
|
|
|
|
@Component({
|
2021-12-28 10:29:25 +00:00
|
|
|
templateUrl: './misc.component.html',
|
2021-12-09 14:24:42 +00:00
|
|
|
})
|
2021-12-28 10:29:25 +00:00
|
|
|
export class MiscComponent implements OnInit {
|
2021-12-09 14:24:42 +00:00
|
|
|
|
|
|
|
value = 0;
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
const interval = setInterval(() => {
|
|
|
|
this.value = this.value + Math.floor(Math.random() * 10) + 1;
|
|
|
|
if (this.value >= 100) {
|
|
|
|
this.value = 100;
|
|
|
|
clearInterval(interval);
|
|
|
|
}
|
|
|
|
}, 2000);
|
|
|
|
}
|
|
|
|
}
|