title: Why *Change EventEmitter listeners are emitted two times in Angular (custom two-way data binding property)?
body: <p>Here is the way how to create two-way-data-binding in Angular: <a href="https://blog.thoughtram.io/angular/2016/10/13/two-way-data-binding-in-angular-2.html#creating-custom-two-way-data-bindings" rel="nofollow noreferrer">https://blog.thoughtram.io/angular/2016/10/13/two-way-data-binding-in-angular-2.html#creating-custom-two-way-data-bindings</a></p>
  
  <p>For example I created <code>counter</code> two-way data binding property in a component. It works. Now I also want to get notifications about changing the property using <code>counterChange</code> output of the component.</p>
  
  <p>Here is the code of the component: </p>
  
  <pre><code>export class CustomCounterComponent {
  
    counterValue = 0;
    @Output() counterChange = new EventEmitter();
  
    @Input()
    get counter() {
      return this.counterValue;
    }
  
    set counter(val) {
      this.counterValue = val;
      this.counterChange.emit(this.counterValue);
    }
  
    decrement() {
      this.counter--;
    }
  
    increment() {
      this.counter++;
    }
  }
  </code></pre>
  
  <p>Here is how I use it:</p>
  
  <pre><code>@Component({
    selector: 'my-app',
    template: `
      &lt;custom-counter [(counter)]="counterValue" (counterChange)="onChange($event)"&gt;&lt;/custom-counter&gt;
      &lt;p&gt;&lt;code&gt;counterValue = {{counterValue}}&lt;/code&gt;&lt;/p&gt;
    `
  })
  export class AppComponent {
    onChange(value) {
      console.log('onChange!', value)
    }
    counterValue = 5;
  }
  </code></pre>
  
  <p>Desired behavior: I expect <code>onChange</code> to be called 1 time when value changes.</p>
  
  <p>Specific problem: <code>onChange</code> is called two times each time values changes.</p>
  
  <p>Any thoughts why it is called 2 times? </p>
  
  <p>Also, I have full plunkr example: <a href="https://plnkr.co/edit/8HGXNhhYQRoLVJeDlqWK?p=preview" rel="nofollow noreferrer">https://plnkr.co/edit/8HGXNhhYQRoLVJeDlqWK?p=preview</a>. Just open console and look there.</p>