Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { TimerObservable } from 'rxjs/observable/TimerObservable';
- import 'rxjs/add/operator/take';
- countdown = TimerObservable.create(0, 1000).take(6);
- startCountdownTimer(): void {
- this.countdown.subscribe(
- i => this.timeRemaining = (5 - i).toString(),
- null,
- () => this.toDelete = -1)
- }
- cancelCountdownTimer(): void {
- this.countdown.unsubscribe();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement