New base code for mempool blockchain explorerer

This commit is contained in:
Simon Lindh
2020-02-16 22:15:07 +07:00
committed by wiz
parent ca40fc7045
commit ac95c09ea6
204 changed files with 6959 additions and 14341 deletions

View File

@@ -0,0 +1,29 @@
import { Component, OnInit, OnDestroy, ChangeDetectionStrategy, Input, ChangeDetectorRef } from '@angular/core';
@Component({
selector: 'app-time-since',
template: `{{ time | timeSince : trigger }}`,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class TimeSinceComponent implements OnInit, OnDestroy {
interval: number;
trigger = 0;
@Input() time: number;
constructor(
private ref: ChangeDetectorRef
) { }
ngOnInit() {
this.interval = window.setInterval(() => {
this.trigger++;
this.ref.markForCheck();
}, 1000 * 60);
}
ngOnDestroy() {
clearInterval(this.interval);
}
}