21 lines
370 B
TypeScript
21 lines
370 B
TypeScript
|
|
|
|
import { Component } from '@angular/core';
|
|
import { Observable } from 'rxjs';
|
|
|
|
@Component({
|
|
selector: 'app-stopwatch',
|
|
templateUrl: './stopwatch.component.html'
|
|
})
|
|
export class StopwatchComponent {
|
|
|
|
stopwatchValue: number;
|
|
stopwatchValue$: Observable<number>;
|
|
|
|
start() {
|
|
this.stopwatchValue$.subscribe(num =>
|
|
this.stopwatchValue = num
|
|
);
|
|
}
|
|
}
|