Q:

How to access angular $scope controller in directive link? 

I want to access $scope in controller from my directive link.  It failed and threw an error.  Thanks for your help. 
The error is type error: scope.something is undefined. 
HTML
<div ng-controller="myController">
  show me something {{ something }}
  <!--  this is a canvas -->
  <my-directive></my-directive>
</div>

JS
angular.module('fooBar',[]).controller(myController, ['$scope', function($scope) {
   // this is the something
   $scope.something = false;
}]).directive(myDirective, function(){
  return {
    template: '<canvas width='500px' height='500px'></canvas>',
    link: function(scope, el, attr) {
      //how to access that 'something'
      var bah = scope.something;
    }
  };
});

UPDATE
Really thanks to you all.  especially to u @immirza
im so sorry i cant reply u one by one. 
it just add $parent
//how to access that 'something'
var bah = scope.$parent.something

A:

FYI, the scope is parent to directive so you need access as parent scope. 
Try following and it should work. 

Also, the best way to know why it throw not defined error... put a
  breakpoint to the line, mouse over to $scope and and see all available
  items to scope. 

angular.module('fooBar',[]).controller(myController, ['$scope', function($scope) {
   // this is the something
   $scope.something = false;
}]).directive(myDirective, function(){
  return {
    template: '<canvas width='500px' height='500px'></canvas>',
    link: function(scope, el, attr) {
      //how to access that 'something'
      var bah = scope.$parent.something; // added parent. 
    }
  };
});

