1import { Component } from '@angular/core';
2@Component({
3 selector: 'my-app',
4 template: `{{ now }}`
5})
6export class AppComponent {
7 public now: Date = new Date();
8
9 constructor() {
10 setInterval(() => {
11 this.now = new Date();
12 }, 1);
13 }
14}