Files
angular-challenges/apps/angular/injection-token/src/app/timer.component.ts

14 lines
351 B
TypeScript

import { Component } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { interval } from 'rxjs';
import { DEFAULT_TIMER } from './data';
@Component({
selector: 'timer',
standalone: true,
template: ` Timer running {{ timer() }} `,
})
export class TimerComponent {
timer = toSignal(interval(DEFAULT_TIMER));
}