<p dir="auto">In Angular1 when we have ng-model="obj.prop" and if obj does not exist, It will not throw any error. If user type anything on that input new obj Object created with prop.</p>
<p dir="auto">However, In Angular 2 when we pass undefined object from parent to child component as <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/input/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/input">@input</a> and use as [(ngModel)]="obj.prop", If obj is defined in parent it works and even sync data with parent component. But, if it is not defined there it give an error : "Cannot read property 'prop' of undefined"</p>
<p dir="auto">If I use elvis operator as [ngModel]="field?.value" (ngModelChange)="field ? field.value = $event : null" It eliminate error but then it does not sync with parent component.</p>
<p dir="auto">We are using this as part of dynamic component. And we does not know if that object is defined or not. If not it should be like it does in Angular 1.</p>
<ul dir="auto">
<li><strong>I'm submitting a ...</strong><br>
[ ] bug report<br>
[x] feature request<br>
[ ] support request</li>
<li><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong></li>
</ul>
<p dir="auto">Feature</p>
<ul dir="auto">
<li><strong>What is the current behavior?</strong></li>
</ul>
<p dir="auto">A2 supports the elvis operator (?.) in property bindings but not "two-way" bindings.</p>
<p dir="auto">This is ok: <code class="notranslate">[ngModel]="hero?.name"</code>.</p>
<p dir="auto">A2 throws an error if I write <code class="notranslate">[(ngModel)]="hero?.name"</code> because this de-sugars (in part) to <code class="notranslate">(ngModelChange)="hero?.name=$event"</code> and the elvis operator (?.) is not supported in assignments.</p>
<p dir="auto">Today's workaround is  <code class="notranslate">[ngModel]="hero &amp;&amp; hero.name"</code>. We can do better.</p>
<ul dir="auto">
<li><strong>If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem</strong> via<br>
<a href="https://plnkr.co" rel="nofollow">https://plnkr.co</a> or similar (you can use this template as a starting point: <a href="http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5" rel="nofollow">http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5</a>).</li>
<li><strong>What is the expected behavior?</strong></li>
</ul>
<p dir="auto">Recommend that template statements support elvis in assignments.</p>
<p dir="auto">For example, the following <code class="notranslate">&lt;input&gt;</code> element event binding — <code class="notranslate">(input)="hero?.name = $event.target.value"</code> — should assign the value to <code class="notranslate">hero.name</code> if <code class="notranslate">hero != null</code>; if <code class="notranslate">hero == null</code> it should do nothing.</p>
<p dir="auto">It follows that we will then support <code class="notranslate">[(ngModel)]="hero?.name"</code> which was the original motivation for this request.</p>
<ul dir="auto">
<li><strong>What is the motivation / use case for changing the behavior?</strong></li>
</ul>
<p dir="auto">Elvis is useful in binding syntax ... both in property binding template expressions and event binding template statements involving assignment.</p>
<p dir="auto">The 2-way binding syntax today prevents usage of elvis, even if we only wanted it for the property binding half of that syntax.</p>
<ul dir="auto">
<li><strong>Please tell us about your environment:</strong></li>
<li>Angular version: 2.0.0-beta.11 everywhere</li>
</ul>