title: AngularJS pass parameters in directive template to controller
body: <p>In my app i have such directives:</p>
  
  <pre><code>.directive('nodeList', function($compile) {
      return {
          restrict: 'E',
          terminal: true,
          scope: {
              nodes: '=ngModel',
              deleteArticle: '&amp;',
              editArticle: '&amp;'
          },
          link: function ($scope, $element, $attrs) {
              if (angular.isArray($scope.nodes)) {
                  $element.append('&lt;accordion close-others="true"&gt;&lt;node ng-repeat="item in nodes" ng-model="item" delete-article="deleteArticle(node_item)" edit-article="editArticle(node_item)"&gt;&lt;/node&gt;&lt;/accordion&gt;');
              } 
              $compile($element.contents())($scope.$new());
          }
      };
  })
  
  .directive('node', function($compile) {
      return {
          restrict: 'E',
          terminal: true,
          scope: {
              node: '=ngModel',
              deleteArticle: '&amp;',
              editArticle: '&amp;'
          },
          link: function ($scope, $element, $attrs) {
              if (angular.isArray($scope.node.Options) &amp;&amp; $scope.node.Options.length &gt; 0) {
                  $element.append('&lt;accordion-group&gt;&lt;accordion-heading&gt;{{node.Title}}   &lt;a href=\"javascript:void(0)\" ng-click=\"editArticle({node_item: node})\" data-toggle=\"modal\" data-target=\"#new-article\" class=\"action\"&gt;&lt;i class=\"glyphicon glyphicon-edit\"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/accordion-heading&gt;&lt;node-list ng-model="node.Options"&gt;&lt;/node-list&gt;{{node.Content}}&lt;/accordion-group&gt;');
              } else {
                  $element.append('&lt;accordion-group&gt;&lt;accordion-heading&gt;{{node.Title}}   &lt;a href=\"javascript:void(0)\" ng-click=\"editArticle({node_item: node})\" data-toggle=\"modal\" data-target=\"#new-article\" class=\"action\"&gt;&lt;i class=\"glyphicon glyphicon-edit\"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/accordion-heading&gt;{{node.Content}}&lt;/accordion-group&gt;');
              }
              $compile($element.contents())($scope.$new());
          }
      };
  })
  </code></pre>
  
  <p>and such html:</p>
  
  <pre><code>&lt;node-list ng-model="articles" delete-article="deleteArticle(node_item)" edit-article="editArticle(node_item)"&gt;&lt;/node-list&gt;
  </code></pre>
  
  <p>and in controller:</p>
  
  <pre><code>$scope.editArticle = function(vArticle) {}
  </code></pre>
  
  <p>when i have only one directive - all is clear, but how to pass parameters when my directive is calling another directive? is it real? and how?</p>