title: Is there a way to check for @Output wire up from within a component in Angular?
body: <p>In the <code>ngOnInit</code> method of a component the <code>@Input</code> values will have been bound so you can check those properties on the component, but there doesn't seem to be a way to check <code>@Output</code> event bindings. I want to be able to know if the <code>@Output</code> was wired up on the component or not.</p>
  <p>(using Angular and TypeScript)</p>
  <pre><code>import {Component, Output, EventEmitter} from '@angular/core';
  
  @Component({
      selector: 'sample',
      template: `&lt;p&gt;a sample&lt;/p&gt;`
  })
  export class SampleComponent {
      @Output() cancel = new EventEmitter();
      
      ngOnInit() {
          // would like to check and see if cancel was used
          // on the element &lt;sample (cancel)=&quot;doSomething()&quot;&gt;&lt;/sample&gt; 
          // or not &lt;sample&gt;&lt;/sample&gt;
      }
  }
  </code></pre>