title: How to cancel a subscription in Angular2
body: <p>How does one cancel a subscription in Angular2?  RxJS seems to have a dispose method, but I can't figure out how to access it.  So I have code that has access to an EventEmitter and subscribes to it, like this:</p>
  
  <pre><code>var mySubscription = someEventEmitter.subscribe(
      (val) =&gt; {
          console.log('Received:', val);
      },
      (err) =&gt; {
          console.log('Received error:', err);
      },
      () =&gt; {
          console.log('Completed');
      }
  );
  </code></pre>
  
  <p>How can I use <code>mySubscription</code> to cancel the subscription?</p>