angular-data-table
angular-data-table copied to clipboard
Pass cell scope to header renderer function
Currently one of the demos is showing that cellScope is passed to the headerRenderer
function similar to the cellRenderer
. After looking at the code it was only passing the element.
Passing scope allows user to set things on scope within the headerRenderer
function which the template can use to render. Example:
columns: [
{
name: 'Test'
headerRenderer: function(scope, elem) {
scope.someObjectInCellScope = {
value: 'Hi there'
};
return `<span>{{ someObjectInParentScope.value }} - {{ someObjectInCellScope.value }}</span>`
}
}
]