title: how to apply a jquery code in angular directive
body: <p>I need insert a jquery code in a angular component, this jquery was in the html so not good practice.</p>
  
  <p>I tried create a new function there and insert my jquery code , the jquery it is working very well, but i don't know why, the function link is now broken and not working.</p>
  
  <p>I am new using angular and js so i can't understand well , can someone help to solve this? explain what is wrong in the code and i broken the function above</p>
  
  <p>Thank you.</p>
  
  <p>jquery code I tried to apply</p>
  
  <pre><code>  $('#close, #menu-toggle').click(function(e) {
            e.preventDefault();
            $('#wrapper').toggleClass('toggled');
          });
  </code></pre>
  
  <p><strong>angular file:</strong></p>
  
  <pre><code> angular.module('test').directive('leftBar', [
        'leftBarService',
        function leftBar(leftBarService) {
          'use strict';
  
          var
            scope = {
              onLeafNode: '='
            };
  
          function link($scope, $element) {
            $element.leftBar({
              speed: 1000,
              useDynamicLoading: false,
              onLeafNodeReched: $scope.onLeafNode
            });
  
          }
  
          function menu ($scope, $element){
              $('#close, #menu-toggle').click(function(e) {
              e.preventDefault();
              $('#wrapper').toggleClass('toggled');
            });
          }
  
          return {
            restrict: 'A',
            scope: scope,
            link: link,
            link:menu,
            templateUrl: 'app/test/leftBar/leftBar.html'
          };
        }
  
      ]);
  </code></pre>