0

I have:

<tr ng-class="{{line.color}}" ng-repeat="line in gameRank | orderBy: sortType: sortReverse">
    <td>{{$index + 1}}</td>
    <td>{{line.username}}</td>
    <td>{{line.games}}</td>
    <td>{{line.winners}}</td>
</tr>

When I open debugger I see:

<tr class="ng-scope" ng-class="BLUE" ng-repeat="line in gameRank | orderBy: sortType: sortReverse">
    <td class="ng-binding">1</td>
    <td class="ng-binding">Admin</td>
    <td class="ng-binding">0</td>
    <td class="ng-binding">0</td>
</tr>

So, my class BLUE is not applied to my element.

How can I fix it?

1
  • 1
    ng-class="{{line.color}}" --> ng-class="line.color" Commented Feb 2, 2017 at 11:20

1 Answer 1

2

It should be

<tr ng-class="line.color" ...>

Instead of

<tr ng-class="{{line.color}}" ...>

JSFiddle demo

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.