I am currently working on refactoring a switch statement that identifies specific classes upon page load into one of my controllers.
Does anyone have suggestions on how I can transform this straightforward task using Angular?
$('.radior').each(function() {
var ones = $(this).find('.newone'); // newone's of current .radior
var count = ones.length;
switch (count) {
case 1:
case 2:
case 3:
var sub = ['full', 'half', 'third'];
ones.addClass( sub[count - 1] + " col-xs-12 col-md-" + (12 / count));
break;
case 4:
ones.addClass( "quarter col-xs-12" );
break;
case 5:
ones.addClass( "another col-xs-12" );
break;
}
});
Any assistance on this matter would be highly valued. Thank you.