Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import { TimerObservable } from 'rxjs/observable/TimerObservable';
  2. import 'rxjs/add/operator/take';
  3.  
  4. countdown = TimerObservable.create(0, 1000).take(6);
  5.  
  6. startCountdownTimer(): void {
  7. this.countdown.subscribe(
  8. i => this.timeRemaining = (5 - i).toString(),
  9. null,
  10. () => this.toDelete = -1)
  11. }
  12.  
  13. cancelCountdownTimer(): void {
  14. this.countdown.unsubscribe();
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement