The AngularJS Noob Handbook has some code which reduces class manipulation to a simple expression and binding :
...&
Here's how you can pass expression with filter:
....