From http://questiontrack.com/using-filters-inside-a-ternary-operator-in-angularjs-1062149.html