Correct use of Elvis operator in Angular2 for Dart component's view
As the error message says it can't be used for assignment. Where should the value be assigned to when name
is null?
If you split the short form to the more explicit one
[ngModel]="name?.first" (ngModelChange)="name.first=$event"
then you can use the elvis operator.
In the case that name is null you can also do this
<input type="text" *ngIf="name" [(ngModel)]="name.first">