I want to apply a different badge color with bootstrap depending on a number.I wrote a filter to accomplish this...angular.module('Demo')    .filter('reserveStatus', function() {        return function(num) {            var klass = ;            num = parseInt(num, 10);            if (num > 2 && num < 5) {                klass = alert-success;            }                                else if (num >= 5 && num < 10) {                klass = alert-warning;            }            else if (num >= 10) {                klass = alert-danger;            }            return klass;        }    });And it's used with interpolation like this...<span class=badget {{reserve.qty | reserveStatus}}></span>Is this a good way to accomplish this?
Is a filter a good way to accomplish a dynamic class in angular?
javascript;angular.js
Fun question, I think this is okay.I would name klass -> class and I would consider building a map for the values:var classMap = [  { from : 3 , to : 5       , class : 'alert-success' },  { from : 5 , to : 10      , class : 'alert-warning' },  { from : 10, to : Infinity, class : 'alert-danger'  }];