title: Angular2 ControlValueAccessor
body: <p>i'm trying to understand how ControlValueAccessor work precisely.</p>
  
  <p>I have studied the behavior of it with two different control component:</p>
  
  <ul>
  <li>The first is suppose to provide a primitive value: a single number.</li>
  <li>The second provide a complex object.</li>
  </ul>
  
  <p>So in short:</p>
  
  <pre><code>class FirstControlComponent implements ControlValueAccessor {
      // ...
      value:number = 10;
      writeValue(value: number) {
          this.value = value;
      }
      // ...
  }
  
  class SecondControlComponent implements ControlValueAccessor {
      // ...
      value:any = {};
      writeValue(value: any) {
          this.value = value;
      }
      // ...
  }
  </code></pre>
  
  <p>The ControlValueAccessor interface only specify a 'setter': <strong>writeValue</strong>, but no 'getter'.</p>
  
  <p>So when i bind a Control to SecondControlComponent, something like:</p>
  
  <pre><code>this.form = this.builder.group({
      controlName: this.builder.control(this.theObject) });
  </code></pre>
  
  <p>and later in the template:</p>
  
  <pre><code>&lt;second-component ngControl='controlName'&gt; &lt;second-component&gt;
  </code></pre>
  
  <p>Everything works just fine, because writeValue is called on init with a reference to the existing theObject object, so the control modify the same instance of the object (hope i'm clear)</p>
  
  <p><strong>BUT:</strong> if i do exactly the same thing with FirstControlComponent, <strong>because</strong> the value is not passed as a reference (cause it's a primitive), and <strong>because</strong> ControlValueAccessor do not provide a 'setter' the value in my control and the value in my host component are NOT kept in sync ... </p>
  
  <p>Does this mean that we HAVE to pass Object and not primitive to custom control implementing the ControlValueAccessor? I Guess no, so i guess i must be misunderstanding something .. :)</p>
  
  <p>I'm using it the right way ?</p>
  
  <p>Any hints are welcome !</p>
  
  <p>Thanks !</p>