The custom filter here seems overkill for what could be done with:

    ng-class="{ active: task.state === 'pending' }"