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