title: angular 2 ngModel parse error with Elvis operator
body: <p>I am trying to do two way binding in AngularJs and I got this error:</p>
  <pre><code>Parser Error: The '?.' operator cannot be used in the assignment at column 48 in [data.insObj.static['AHV,IV,EO']?.employerShare=$event]
  </code></pre>
  <p>My ngModel looks like this:</p>
  <pre><code>[(ngModel)]=&quot;data.insObj.static['AHV,IV,EO']?.employerShare&quot;
  </code></pre>
  <p>How can I fix this?</p>
  <p><a href="https://i.stack.imgur.com/jrRZ2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jrRZ2.jpg" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/jrRZ2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jrRZ2.jpg" alt="enter image description here" /></a></p>
  <p><strong>UPDATE</strong></p>
  <p>I have this code</p>
  <pre><code>&lt;input type=&quot;text&quot; class=&quot;form-control&quot;
                         id=&quot;employerShare&quot;
                         name=&quot;data.insObj.static['AHV,IV,EO'].employerShare&quot;
                         placeholder=&quot;5.125%&quot;
                         [ngModel]=&quot;data.insObj.stat['AHV,IV,EO']?.employerShare&quot;
                         (ngModelChange)=&quot;data.insObj.static['AHV,IV,EO'].employerShare = $event&quot;&gt;
  </code></pre>
  <p>when I change the input field, it raises an error of</p>
  <blockquote>
  <p>Cannot read property 'AHV,IV,EO' of undefined</p>
  </blockquote>
  <p>I am converting this from an object to an array from the component like this</p>
  <pre><code>this.data.insObj.stat = response.body.static;
  this.data.insObj.stat = this.convertObj(response.body.static);
  </code></pre>
  <p>and my function that converts it to array looks like this:</p>
  <pre><code>public convertObj(obj) {
  
      var custObj = [];
      var array = $.map(obj, function (value, index) {
          custObj[index] = value;
      });
  
      return custObj;
  }
  </code></pre>
  <p>can you help me out in here, why is falling down in ngModelChange</p>
  <pre><code>&quot;static&quot;: {
    &quot;AHV,IV,EO&quot;: {
      &quot;id&quot;: 19,
      &quot;employerShare&quot;: &quot;0.05125&quot;,
      &quot;employeeShare&quot;: &quot;0.05125&quot;,
      &quot;numberOfCompensationFound&quot;: &quot;123.456&quot;,
      &quot;insuranceNumber&quot;: &quot;278.12312.123.456&quot;,
      &quot;insuranceName&quot;: null,
      &quot;man&quot;: null,
      &quot;woman&quot;: null,
      &quot;customerNumber&quot;: null,
      &quot;subNumber&quot;: null,
      &quot;contractNumber&quot;: null,
      &quot;upperLimit&quot;: null,
      &quot;isSuva&quot;: null,
      &quot;dateOfContribution&quot;: &quot;2017-03-02T08:30:01.095Z&quot;,
      &quot;yearOfContribution&quot;: 2017,
      &quot;createdAt&quot;: &quot;2017-03-02T08:30:01.095Z&quot;,
      &quot;updatedAt&quot;: &quot;2017-03-06T11:02:22.323Z&quot;,
      &quot;insuranceContributionHeaderId&quot;: 11,
      &quot;companyId&quot;: 12,
      &quot;insuranceContributionHeader.id&quot;: 11,
      &quot;insuranceContributionHeader.insuranceName&quot;: &quot;AHV,IV,EO&quot;,
      &quot;insuranceContributionHeader.isFixed&quot;: true
    },
  </code></pre>