title: Pass value from controller to directive
body: <p>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:</p>
  
  <p>Here is Directive</p>
  
  <pre><code>.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
        }
      };
  });
  </code></pre>
  
  <p>Here is Html where I call the Directive</p>
  
  <pre><code>&lt;canvas id="test" angular-data ="lineChartData" height="450" width="600"&gt;&lt;/canvas&gt;
  </code></pre>
  
  <p>Here is controller Code</p>
  
  <pre><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]
        }  
      ]
  }
  </code></pre>