Skip to content

Commit

Permalink
Sort undefined values as empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiash committed Dec 18, 2013
1 parent 8334167 commit e3047c2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions js/angular-tablesort.js
Expand Up @@ -83,6 +83,12 @@ tableSortModule.directive('tsWrapper', function( $log, $parse ) {
aval = filterFun( aval );
bval = filterFun( bval );
}
if( aval === undefined ) {
aval = "";
}
if( bval === undefined ) {
bval = "";
}
descending = $scope.sortExpression[i][2];
if( aval > bval ) {
return descending ? -1 : 1;
Expand Down

0 comments on commit e3047c2

Please sign in to comment.