Angular2 + RxJS - cannot read property next of undefined
<p>I have created the next component:</p>

<pre><code>export class MonthView {
  currentMonth: Moment = moment();
  currentMonth$: Observable&lt;Moment&gt;;
  currentMonthObserver: Observer&lt;Moment&gt;;
  decrement: Function;
  increment: Function;

  constructor() {
    this.currentMonth$ = new Observable((observer: Observer&lt;Moment&gt;) =&gt; {
      this.currentMonthObserver = observer;
    }).share();

    const decrementCounter$: Observable&lt;Function&gt; = Observable.create((observer) =&gt; {
      this.decrement = () =&gt; {
        observer.next();
      };
    });

    const incrementCounter$: Observable&lt;Function&gt; = Observable.create((observer) =&gt; {
      this.increment = () =&gt; {
        observer.next();
      };
    });

    Observable
      .merge(
        decrementCounter$.map(() =&gt; - 1),
        incrementCounter$.map(() =&gt; + 1)
      )
      .startWith(0)
      .scan((currentCount: number, value: number) =&gt; currentCount + value)
      .subscribe((count: number) =&gt; {
        this.currentMonthObserver.next(this.currentMonth.clone().add(count, 'M')); //this.currentMonthObserver is undefined
      });
  }
} 
</code></pre>

<p>The Problem: 
I am getting: <code>Cannot read property 'next' of undefined</code> for the <code>this.currentMonthObserver.next</code> line (see the comment in the posted code).  </p>

<p><em>NOTE:</em> I have followed the tutorial on this blog, and I am a totally new to RxJS: <a href="https://coryrylan.com/blog/angular-2-observable-data-services" rel="nofollow noreferrer">https://coryrylan.com/blog/angular-2-observable-data-services</a> </p>

<p>template:</p>

<pre><code>&lt;month-board [current-month]="currentMonth$"&gt;&lt;/month-board&gt;
&lt;button (click)="decrement()"&gt;Prev&lt;/button&gt;
&lt;button (click)="increment()"&gt;Next&lt;/button&gt;
</code></pre>

<p><a href="https://i.stack.imgur.com/cROe2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cROe2.png" alt="enter image description here"></a></p>