function getDirective(name) {
  var directiveName = 'md' + name;
  var eventName = '$md.' + name.toLowerCase();

  return DirectiveFactory;

  /* @ngInject */
  function DirectiveFactory($parse) {
      return { restrict: 'A', link: postLink };
      function postLink(scope, element, attr) {
        var fn = $parse(attr[directiveName]);
        element.on(eventName, function(ev) {
          var currentTarget = ev.currentTarget;
          scope.$applyAsync(function() { fn(scope, { $event: ev, $target: { current: currentTarget } }); });
        });
      }
    }
}
@ngdoc directive
@module material.components.swipe
@name mdSwipeDown

@restrict A

@description
The md-swipe-down directive allows you to specify custom behavior when an element is swiped
down.

### Notes
- The `$event.currentTarget` of the swiped element will be `null`, but you can get a
reference to the element that actually holds the `md-swipe-down` directive by using
`$target.current`

> You can see this in action on the <a ng-href="demo/swipe">demo page</a> (Look at the Developer
Tools console while swiping).

@usage
<hljs lang="html">
<div md-swipe-down="onSwipeDown($event, $target)">Swipe me down!</div>
</hljs>