title: rxjs6 Timer not being triggered in Angular 6 subscription to observable timer placed in service
body: <p>I'm trying to put a timer from rxjs 6 in an angular 6 service. And it's  not being triggered. I looked in the documentation without any luck. This is my service code(only the relevant part:</p>
  
  <pre><code>import { map,flatMap, catchError, take } from 'rxjs/operators';
  import { BehaviorSubject, of, throwError,timer, Observable } from "rxjs";
  
  .....
  
    countdownTimer = new Observable&lt;number&gt;();
  
  
    formatCountdownTime(count) {
      const seconds = count % 60 &lt; 10 ? '0' + Math.floor(count % 60) : Math.floor(count % 60);
      /*    if(count &lt;= 1000){
           //set timer to NOT RUNNING state so it updates UI components like the button that depends on the count
            this.contributorManagerService.countdownTimerIsRunning.next(false);
         } */
         return Math.floor(count / 60) + ':' + seconds;
    }
  
    createCountdownTimerObservable(count){
      this.countdownTimer =  timer(0, 1000);
  
    }
  </code></pre>
  
  <p>and this is the consumption of the timer. I need to know when time has elapsed and that's why I'm passing that 3rd function parameter to the subscription since I need to enable a button when the time is up.</p>
  
  <pre><code>import { map,take } from 'rxjs/operators';
  
  
  export class CampaignDataComponent implements OnInit, OnDestroy {
  
   countdownTimerIsRunning = false ;
   count: number;
  
  
  ngOnInit(){
  
  /* I subscribe to the timer and the 3rd parameter indicates what to do when time has elapsed */
        this.sharedHelpersService.countdownTimer.
        pipe(
          take(this.count),
          map(() =&gt; {
            --this.count;
  
            return this.count;
          })
        ).subscribe(count=&gt;{
          console.log("New count",count);
  
            if(count&gt;0){
               this.countdownTimerIsRunning = true;
            }
        },
        err=&gt;{
          console.log("Countdown timer error", err);
        },
        ()=&gt;{
          console.log("Time has elapsed");
          this.countdownTimerIsRunning = false;
        });
  
  }
  
  }
  </code></pre>
  
  <p>Do you know why is not being triggered? It used to work when I used the whole chain on the component but since I need to consume it from other components I had to put it in a service and that broke it. Any ideas?. Thank you very much in advance</p>
  
  <p>EDIT: Just to clarify, they all the components should consume the same countdown</p>