Switch code to angular.isNumber function usage