title: Why I get error at my service in Angular 6?
body: <p>I have a service:</p>
  
  <pre class="lang-js prettyprint-override"><code>import { EventEmitter, Injectable } from '@angular/core';
  
  @Injectable()
  export class PingOnActionListenerService {
      removingListener = new EventEmitter();
  
      removeListener(): void {
          this.removingListener.emit();
      }
  </code></pre>
  
  <p>At component A I call the service:</p>
  
  <pre class="lang-js prettyprint-override"><code>this._pingOnActionListenerService.removeListener();
  </code></pre>
  
  <p>At component B I want to listen to the service:</p>
  
  <pre class="lang-js prettyprint-override"><code>    ngOnInit() {
          this._pingOnActionListenerService.removingListener.subscribe(this.deactivatelistener());
      }
  
      deactivatelistener() {
          window.removeEventListener('click', this.pingIfLastPingIsOld);
      }
  </code></pre>
  
  
  
  <p>When I run this code,
  I get at the console the error message:</p>
  
  <blockquote>
    <p>core.js:1671 ERROR TypeError: generatorOrNext is not a function
        at SafeSubscriber.schedulerFn [as _next] (core.js:3565)
        at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:195)
        at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:133)
        at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:77)
        at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
        at EventEmitter.push../node_modules/rxjs/_esm5/internal/Subject.js.Subject.next (Subject.js:47)
        at EventEmitter.push../node_modules/@angular/core/fesm5/core.js.EventEmitter.emit (core.js:3537)
        at <strong>PingOnActionListenerService.push../src/app/core/services/ping-on-action/ping-on-action-listener.service.ts.PingOnActionListenerService.removeListener</strong> (ping-on-action-listener.service.ts:19)
        <strong>at CatchSubscriber.selector</strong> (logging-interceptor.ts:45)
        at CatchSubscriber.push../node_modules/rxjs/_esm5/internal/operators/catchError.js.CatchSubscriber.error (catchError.js:33)</p>
  </blockquote>