I have an array field consisting of numeric digits in the angular component.
venuesRunning: any = [13, 14];
I need to activate a class on the row of the table within the HTML template
based on a condition which checks if the index of the row is within the
component array(`venuesRunning`). Below is the code I tried to use
<tr
*ngFor="let v of mf.data; index as i"
[class.bg-primary]="i in venuesRunning">
{{ v }}
</tr>
I am getting syntax error stating
> [Angular] Parser Error: Unexpected token 'in' at column 3 in [i in
venuesRunning] in @64:53
Then i tried this but it is
<tr *ngFor="let v of mf.data; index as i" [class.bg-primary]=
"venuesRunning[i]">
But the above code is not working correctly. Its activating 0th and 1st
index rows of template table rather than 13th and 14th index rows
What am I doing wrong here? Can someone correct me?
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.