I have simple angular / html code where I have a table and on each <li> there is checkbox and some text
My code looks like:
<li ng-repeat="task in tasks | filter:statusFilter track by $index" ng-class="{completed: todo.completed}" ng-cloak> <div class="view"> <input class="toggle" type="checkbox" ng-model="todo.completed" ng-click="changeStatus(task.id)"> <label ng-dblclick="editTodo(todo)">{{task.text}}</label> <button class="destroy" ng-click="removeeTask(task)"></button> </div> <form ng-submit="doneEditing(todo)"> <input class="edit" ng-trim="false" ng-model="todo.title" ng-blur="doneEditing(todo)" todo-escape="revertEditing(todo)" todo-focus="todo == editedTodo"> </form> </li> What this code do is:
- When user click CHECKBOX it call ng-click and update "active" in database
- Add "completed" which basicly change style of that
<li>a bit
All data comes from some webservices and each task I have contains this information:
My problem is that when I refresh the page I don't have any filter which add completed to all task which active is 0
Can someone help me how to make some if / else condition for this purpose?