You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
679 B
27 lines
679 B
import {Component, HostListener, OnInit} from "@angular/core";
|
|
import {AbsApp} from "./AbsApp";
|
|
|
|
@Component({
|
|
selector: 'app-clock-app',
|
|
template: `
|
|
<div mat-dialog-content>
|
|
<div style="display: flex; justify-content: center">
|
|
<p style="font-family: TechMono, sans-serif; font-size: 60px">{{clockTxt}}</p>
|
|
</div>
|
|
</div>
|
|
`
|
|
})
|
|
export class ClockDialogApp extends AbsApp implements OnInit {
|
|
clockTxt = "";
|
|
inverval:any = null;
|
|
|
|
ngOnInit(): void {
|
|
this.genClock();
|
|
if (this.inverval == null)
|
|
this.inverval = setInterval(() => {this.genClock()},1000)
|
|
}
|
|
|
|
genClock() {
|
|
this.clockTxt = new Date().toLocaleTimeString();
|
|
}
|
|
}
|
|
|