alalonde / angular-scrollable-table

A fixed header table directive for AngularJS
MIT License
68 stars 48 forks source link

minor issue in using custom comparatorFn #53

Closed ReynardLe closed 5 years ago

ReynardLe commented 7 years ago

Hi,

In the sort portion of sortableHeader, you have:

scope.toggleSort = function (e) { if (scope.isActive()) { tableController.toggleSort(); } else { tableController.setSortExpr(expr); } tableController.doSort(scope[attrs.comparatorFn]); e.preventDefault(); }; ...

I can't use attrs.comparatorFn as html automatically renders my comparatorFn to comparatorfn (case-insensitive). Changing the code to use attrs.comparatorfn solves this issue. (Tried to send a PR but didn't have access, so I report this instead.)

Thanks, Reynard.

alalonde commented 5 years ago

Directive attributes should be defined using kebab-case. See https://github.com/alalonde/angular-scrollable-table/blob/master/demo/index.html#L44