angular-cn/aio/content/examples/rx-library/src/naming-convention.ts
2018-03-19 21:51:51 -07:00

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
);
}
}