Call Controller Function from Directive (with params passed from directive)
<p>So what I want to achieve is to pass a function (that takes in 2 parameters) and is defined in the controller, into the directive and gets called with params from the directive with directive params.</p>

<pre><code>.on('click', function(d, i){
    // here I want to call the function from the controller,
    ctrlCB(d, i);
})
</code></pre>

<p>My controller looks a bit like this: </p>

<pre><code>(function () {
'use strict';
angular.module('d3')
    .directive('verticalBarChart', verticalBarChart);
    verticalBarChart.$inject = ['d3Service', '$window', '$parse'];
    function verticalBarChart(d3Service, $window, $parse) {
        return {
            restrict: 'EA',
            scope: {
                data: '=',
                click: '=click'
            },
            link: function (scope, element, attrs) {
                d3Service.d3()
                .then(function (d3) {
                    // some more d3.js stuff
                    svg.selectAll('rect')
                        .data(data).enter()
                        .append('rect')
                        .attr('width', barWidth)
                        .on('click', function (d, i) {
                            scope.click(d, i); // THIS IS THE ONE I'M INTERESTED IN !
                            // on click it calls the function, but the params don't get passed in
                        })
                    }
                });
            }
        };
    }
</code></pre>

<p>the Directive:</p>

<pre><code>&lt;div vertical-bar-chart bar-padding="2" data="barData" click="clickCallback"&gt;&lt;/div&gt;
</code></pre>

<p>and in the controller I would for example have a </p>

<pre><code>$scope.clickCallback = function(d, i){
    $location.url('/item/'+i)
}
</code></pre>