I need help with a ternary condition in an HTML template file:
<div
*ngFor="let $m of $layer.child; let $childIndex=index"
[Latitude]="$m.latitude"
[Longitude]="$m.longitude"
[IconInfo]="$childIndex== 0 ? _iconInfo1:$childIndex== 1 ? _iconInfo
:$childIndex== 2 ? _iconInfo2:$childIndex== 3 ?
_trunkLocMarker1:_trunkLocMarker"></div>
Now, I want to modify the value of a particular property in IconInfo based on a condition like this:
if($m.propertyValue > 1000){
_iconInfo1.property = 'someValue';
}
However, when I tried to incorporate this into the existing ternary condition, I encountered an error:
[IconInfo] = "$childIndex== 0 ? _iconInfo1:$childIndex== 1 ? _iconInfo :$childIndex == 2 ? _iconInfo2 : ($m.totalMou > '1000' ?_iconInfo2.fontSize = '48' : _iconInfo2.fontSize = '48'): $childIndex == 3 ? _trunkLocMarker1 : _trunkLocMarker "
The error message stated:
Uncaught Error: Template parse errors:
Parser Error: Bindings cannot contain assignments
If anyone could provide a solution or suggestion, it would be greatly appreciated.
Thank you!