angular-data-table icon indicating copy to clipboard operation
angular-data-table copied to clipboard

Pass cell scope to header renderer function

Open smoakey opened this issue 7 years ago • 0 comments

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>`
        }
    }
]

smoakey avatar Feb 28 '17 16:02 smoakey