title: Count number of binds on an event
body: <p>I have got a child component which shows a table of data. I want to provide a "select" button on every row, but only if the table is shown in a context where the button is needed, i.e. the table might be shown either standalone or as a selection for a form field.</p>
  
  <p>My idea is to use an EventEmitter for the "select" button and display the button only if there are any subscribers to the event. How is this achieved or are there any better ways to do this?</p>
  
  <p>I'm using angular 2 rc.5</p>
  
  <p>Edit: Example code:</p>
  
  <pre><code>@Component({directives: [Child], template: "&lt;child (select)="onSelect()"&gt;&lt;/child&gt;"})
  class Parent {
  }
  
  @Component({selector: "child", template: "&lt;div *ngIf="showSelect" (click)="onSelect()"&gt;select&lt;/div&gt;"})
  class Child {
      @Output("select") select: EventEmitter&lt;any&gt; = new EventEmitter&lt;any&gt;();
      get showSelect() {
          // return true if there is any subscription to Output("select") 
      }
  }
  </code></pre>
  
  <p>The DIV in the Child component should only be shown if the parent defines a listener to this "select" event. In this case it does by binding it in the template, but it should also work if someone calls .subscribe() directly on the Child component's "select" property.</p>