Angular 2 ngSwitch nested in ngFor -
what correct way use ngswitch
within ngfor
?
if following receive error
got interpolation ({{}}) expression expected
<span *ngfor="let action of actions"> <span [ngswitch]="{{action}}"> <span *ngswitchcase='edit'>edit</span> <span *ngswitchcase='delete'>delete</span> </span> </span>
in bindings (...)
or [...]
don't need interpolate variable string, can use bind it.
<span [ngswitch]="action">
Comments
Post a Comment