title: How to access angular $scope controller in directive link?
body: <p>I want to access <strong>$scope</strong> in controller from my directive link. It failed and threw an error. Thanks for your help.</p>
  
  <p>The error is <code>type error: scope.something is undefined</code>.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;div ng-controller="myController"&gt;
    show me something {{ something }}
    &lt;!-- this is a canvas --&gt;
    &lt;my-directive&gt;&lt;/my-directive&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JS</p>
  
  <pre><code>angular.module('fooBar',[]).controller(myController, ['$scope', function($scope) {
     // this is the something
     $scope.something = false;
  }]).directive(myDirective, function(){
    return {
      template: '&lt;canvas width='500px' height='500px'&gt;&lt;/canvas&gt;',
      link: function(scope, el, attr) {
        //how to access that 'something'
        var bah = scope.something;
      }
    };
  });
  </code></pre>
  
  <p>UPDATE
  Really thanks to you all. especially to u @immirza</p>
  
  <p>im so sorry i cant reply u one by one.
  it just add <code>$parent</code></p>
  
  <pre><code>//how to access that 'something'
  var bah = scope.$parent.something
  </code></pre>