Answers for "angular get current time"

1

angular get current time

import { Component } from '@angular/core';
@Component({
    selector: 'my-app',
    template: `{{ now }}`
})
export class AppComponent {
    public now: Date = new Date();

    constructor() {
        setInterval(() => {
          this.now = new Date();
        }, 1);
    }
}
Posted by: Guest on February-17-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language