Countdown Timer in Angular 6

后端 未结 3 493
挽巷
挽巷 2020-12-31 15:21

Hi I am trying to get an example of a countdown timer I found searching on Stack found here: Time CountDown in angular 2

This is my code:



        
3条回答
  •  长发绾君心
    2020-12-31 15:43

    Simply write:

    import { interval } from 'rxjs';
    import { map } from 'rxjs/operators'
    
    interval(1000).pipe(
      map((x) => { /* your code here */ })
    );
    

    In RxJS 6+ there's no Observable.interval function.

提交回复
热议问题