passing value from parent directive to child directive's template function
<p>I'm trying to access value that is passed from the parent's directive on the child directive's template function.</p>

<p>Please refer to the below plunker.</p>

<p><a href="https://plnkr.co/edit/qjEmuwr2Z9k4ZsywBaIH?p=preview" rel="nofollow">Plunker Link</a></p>

<p>CODE:</p>

<p>Parent Directive:</p>

<pre><code>directive('parentDir', function(){
  return {
    controller: ['$scope',function($scope){
      $scope.myVal = 'HELLO';
    }],
    templateUrl: 'parentDir.html'
  }
})
</code></pre>

<p>Child Directive:</p>

<pre><code>directive('childDir', function(){
  return {
    template: function(element,attrs){
      alert(attrs.val);
    }
  }
})
</code></pre>

<p>parentDir.html:</p>

<pre><code>&lt;div&gt;
  &lt;child-dir val="{{myVal}}"&gt;&lt;/child-dir&gt;
&lt;/div&gt;
</code></pre>