-1

I tried this:

<li ng-repeat="todo in todos" class="{{todo.isCompleted ? 'test'}}">
<input type="checkbox" class="toggle"/>
<label>{{todo.text}}</label><button class="destroy"></button>
</li>

But then I got an error:

Error: Lexer Error: Unexpected next character at columns 17-17 [?] in expression [todo.isCompleted ? 'test']

2

2 Answers 2

6

Use ng-class like this:

<li ng-repeat="todo in todos" ng-class="{ 'test' : todo.isCompleted }">

Reference

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

Comments

2

ng-class="{ 'test' : todo.isCompleted }"

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.