You could just do the following instead of having that entire function for applyButtonClass

   ng-disabled="errataTable.getSelected().length == 0"