Q:

How put a string for result of ternary operator in angular

I fetch datas from a REST API on my Angular app, and try to put text in some text fields.
I tried to use ternary-operator to test if my data exist so I do 
    <input matInput matTooltip="{{index.tooltip}}" pattern="{{index.restriction}}" name="{{index.name}}" 
[(ngModel)]="detailsArray.hasOwnProperty(index.name) ? detailsArray[index.name] : ''" 
[ngModelOptions]="{standalone: true}">

If I don't use the attribute [ngModelOption], there is an error to
but it give me an error, anyone have an idea of Why do the string '' not work ? Is my code wrong ?
My error : 
[ERROR ->][(ngModel)]="detailsArray.hasOwnProperty(index.name) ? detailsArray[index.name] : ''" [ngModelOptions"): ng:///AppModule/DetailsComponent.html@18:108
Parser Error: Unexpected token '=' at column 72 in [detailsArray.hasOwnProperty(index.name) ? detailsArray[index.name] : ''=$event] in ng:///AppModule/DetailsComponent.html@18:108

A:

As Eliseo said in comment, your code is fine for [ngModel], but not for [(ngModel)]. [(ngModel)] is just shortcut for this:
<input [ngModel]="valueToModel" (ngModelChange)="valueToModel = $event" >. See more at guide, where difference between statement and expression is shown.

