swimlane / angular-data-table

A feature-rich but lightweight ES6 AngularJS Data Table crafted for large data sets!
http://swimlane.github.io/angular-data-table/
MIT License
577 stars 143 forks source link

headerRenderer arguments don't match demo (PR?) #197

Open jnelson opened 8 years ago

jnelson commented 8 years ago

It would be useful for headerRenderer to take the same arguments as cellRenderer, as is currently implied in the templates demo at https://github.com/swimlane-contrib/angular-data-table/blob/5bb422f69ec4f77d3aa6ab1006ea6c351eac95f0/demos/templates.html#L80:

                 headerRenderer: function(scope, elm){

Instead, it only gets the element (no scope) https://github.com/swimlane-contrib/angular-data-table/blob/5bb422f69ec4f77d3aa6ab1006ea6c351eac95f0/src/components/header/HeaderCellDirective.js#L59:

            let elm = angular.element(ctrl.column.headerRenderer($elm));

Would you accept a PR to make this potentially breaking change so the code matches the demo? Alternatively, even though it's ugly, we could reverse the order of the arguments to avoid breakage.

jnelson commented 8 years ago

@amcdnl No interest in any change on this one?

amcdnl commented 8 years ago

Whooops, closed on accident! Yes, this looks good. PR and Ill accept :)