title: pass parameter to angular directive on click
body: <p>I am trying to get parameter on click using directive.I want to get child data in the click event for checking has child or not.</p>
  
  <p>.....</p>
  
  <p>html</p>
  
  <pre><code>div ng-app="treeApp"&gt;
  &lt;ul&gt;
      &lt;treeparent&gt;&lt;/treeparent&gt;
  
  &lt;/ul&gt;
  </code></pre>
  
  <p></p>
  
  <p>js</p>
  
  <pre><code>(function () {
  var treeApp = angular.module('treeApp', []);
  treeApp.directive('treeparent', function () {
      return {
          restrict: 'E',
          template: "&lt;button addchild child='m'&gt;ajith&lt;/button&gt;&lt;div id='new'&gt;&lt;/div&gt;"
      }
  });
  treeApp.directive('addchild', function ($compile) {
  
      return {
          scope: {
              'child':'='
          },
          link: function (scope, element, attrs) {
              debugger;
              element.bind("click", function (scope,attrs) {
                  debugger;
  
  //here i want to get hild ie 'm'
   angular.element(document.getElementById('new')).append("&lt;div&gt;&lt;button button class='btn btn-default'&gt;new one&lt;/button&gt;&lt;/div&gt;");
  
  
                   });
          }
      }
  
  });
  })();
  </code></pre>
  
  <p>plz help me</p>