<ng-container *ngFor="let obj of mainData | keyvalue">
<span [@animate]="states.{{obj.key}}">
//////////////////////////////
</span>
</ng-container>
I get an error saying that "Expected expression, got interpolation"
<ng-container *ngFor="let obj of mainData | keyvalue">
<span [@animate]="states.{{obj.key}}">
//////////////////////////////
</span>
</ng-container>
I get an error saying that "Expected expression, got interpolation"
Brackets
[]
expect a expression, e.g. something likestates.obj.key
, whereas on normal attributes you have to use interpolation{{}}
to insert an expression.I think what you meant to write is either
[@animate]="states[obj.key]"
or
@animate="{{ states[obj.key] }}"