I am creating project using angularjs.I have problem while creating custom directive.Actually I want to send the value from controller to directive but I got undefined. Here is my code:

Here is Directive

```
.directive('angularData', function ($parse) {
    return {
      template: false,
      scope: {
        chart: '=lineChartData'
      },
      restrict: 'EA',
      replace: true,
      link: function postLink(scope, element,attrs) {
        var canvas, context, chart, options;
        console.log(attrs)
        console.log(scope.chart) //undefiend
        console.log(chart) //undefiend
      }
    };
});

```

Here is Html where I call the Directive

```
<canvas id="test" angular-data ="lineChartData" height="450" width="600"></canvas>

```

Here is controller Code

```
$scope.lineChartData = {
    labels :[1,4,8,6,8],
    datasets : [
      {
        label: "My First dataset",
        fillColor : "rgba(220,220,220,0.2)",
        strokeColor : "rgba(220,220,220,1)",
        pointColor : "rgba(220,220,220,1)",
        pointStrokeColor : "#fff",
        pointHighlightFill : "#fff",
        pointHighlightStroke : "rgba(220,220,220,1)",
        data : [1,4,8,6,8]
      }  
    ]
}

```