import {Component, HostListener, OnInit} from "@angular/core"; import {AbsApp} from "./AbsApp"; @Component({ selector: 'app-clock-app', template: `

{{clockTxt}}

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