nx-primeng-sakai-v17/src/app/components/misc/misc.component.ts

20 lines
460 B
TypeScript
Raw Normal View History

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);
}
}