title: How set value for all instance of component on page in Angular2?
body: <p>I have following component:</p>
  
  <pre><code>import { Component, Input, Output, OnInit, EventEmitter, ChangeDetectionStrategy } from '@angular/core';
  
  @Component({
    selector: 'counter',
    templateUrl: './counter.component.html',
    styleUrls: ['./counter.component.css'],
    changeDetection: ChangeDetectionStrategy.OnPush
  })
  export class CounterComponent {
  
  ngOnInit()
  {
    this.defaultCount = this.count;
  }
  
    @Input()
    count: number;
    defaultCount: number;
  
    @Output()
    change: EventEmitter&lt;number&gt; = new EventEmitter&lt;number&gt;();
  
    increment() {
      this.count++;
      this.change.emit(this.count);
    }
  
    decrement() {
      if(this.count &gt; 0)
      {
      this.count--;
      this.change.emit(this.count);
      }
    }
  
    reset()
    {
      this.count = this.defaultCount;
      this.change.emit(this.count);
    }
  }
  </code></pre>
  
  <p>template:</p>
  
  <pre><code>&lt;span&gt;{{count}}&lt;/span&gt;
  &lt;div&gt;
    &lt;button (click)="increment()"&gt;Increment&lt;/button&gt;
    &lt;button (click)="decrement()"&gt;Decrement&lt;/button&gt;
    &lt;button (click)="reset()"&gt;Reset&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In parrent component i'm using this component like below.
  It is template:</p>
  
  <pre><code>&lt;counter [count]="5" (change)="countChange($event)"&gt;&lt;/counter&gt;
  &lt;counter [count]="10" (change)="countChange($event)"&gt;&lt;/counter&gt;
  &lt;button (click)="resetAll()"&gt;Reset All&lt;/button&gt;
  </code></pre>
  
  <p>and code:</p>
  
  <pre><code>import { Component } from '@angular/core';
  
      @Component({
        selector: 'app-root',
        templateUrl: './app.component.html',
        styleUrls: ['./app.component.css']
      })
      export class AppComponent {
        title = 'app works!';
        countChange(event) {
          //this.myCount = event;
        }
  
        resetAll(event)
        {
  
        }
      }
  </code></pre>
  
  <p>In <code>resetAll(event)</code> function, I want to set <code>[count]</code> for each instance of this component on the page, as it was before the events of increasing, decreasing or resetting.
  How list only an instance of this component and reset the <code>[count]</code> property by calling reset function of each instance? I'm must add an same Id for each component and find by id  or i can find component by type? In my case the type is <code>CounterComponent</code>.</p>