title: Custom input and output on same name in Angular2 2 way binding
body: <p>I know how to fix my component using a different name for the output value of this component.</p>
  
  <p>let me share my code</p>
  
  <p>import {Component, Input, Output, EventEmitter} from '@angular/core';
  import {TranslationPipe} from "../pipes/translation.pipe";</p>
  
  <pre><code>@Component({
    selector: 'msisdn-confirm',
    template: `
    &lt;div class="msisdn-confirm"&gt;
      &lt;div&gt;
        &lt;input type="text" [(ngModel)]="m1"&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;input type="text" [(ngModel)]="m2"&gt;
      &lt;/div&gt;
      &lt;p class="error"&gt;{{message}}&lt;/p&gt;
    &lt;/div&gt;
  `
  })
  export class MsisdnConfirm {
    message:string;
    @Output('mobile') emitter: EventEmitter&lt;string&gt; = new EventEmitter&lt;string&gt;();
    @Input('mobile') set setMobileValue(value) {
      this.msisdn_confirm = this.msisdn = value;
    }
  
    set m1(value) {
      this.msisdn = value;
      if (this.valid()) {
        console.log('emit' + this.msisdn);
        this.emitter.emit(this.msisdn);
      }
    }
  
    set m2(value) {
      this.msisdn_confirm = value;
      if (this.valid()) {
        console.log('emit' + this.msisdn);
        this.emitter.emit(this.msisdn);
      }
    }
  
    get m1():string {
      return this.msisdn;
    }
    get m2():string {
      return this.msisdn_confirm
    }
  
    msisdn: string;
    msisdn_confirm: string;
  
    constructor() {
  
    }
  
    private valid(): boolean {
      if (!/06[0-9]{8}/.test(this.msisdn)) {
        this.message = new TranslationPipe().transform("Het mobiele nummer is incorrect, (bijvoorbeeld: 0612345678)")
        return false;
      } else if (this.msisdn != this.msisdn_confirm) {
        this.message = new TranslationPipe().transform("De mobiele nummers komen niet overeen")
        return false;
      }
      this.message = null;
      return true;
    }
  }
  </code></pre>
  
  <p>So this is a very basic component which validates two strings to be a "valid" dutch Mobile number, so a confirm box so to say. Now I can get my value in the parent component by doing something like</p>
  
  <pre><code>(mobile)="myParam = $event"
  </code></pre>
  
  <p>What I want is to use it like </p>
  
  <pre><code>[(mobile)]="myParam"
  </code></pre>
  
  <p>This only works for setting though, is this not supported on custom components?</p>