Update to new structure
This commit is contained in:
25
src/app/demo/components/uikit/misc/miscdemo.component.ts
Normal file
25
src/app/demo/components/uikit/misc/miscdemo.component.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: './miscdemo.component.html'
|
||||
})
|
||||
export class MiscDemoComponent implements OnInit, OnDestroy {
|
||||
|
||||
value = 0;
|
||||
|
||||
interval: any;
|
||||
|
||||
ngOnInit() {
|
||||
this.interval = setInterval(() => {
|
||||
this.value = this.value + Math.floor(Math.random() * 10) + 1;
|
||||
if (this.value >= 100) {
|
||||
this.value = 100;
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user