docs: function ngLinkDirective($router, $location, $parse) {
    var rootRouter = $router;
  
    return {
      require: '?^^ngOutlet',
      restrict: 'A',
      link: ngLinkDirectiveLinkFn
    };
  
    function ngLinkDirectiveLinkFn(scope, elt, attrs, ctrl) {
      var router = (ctrl && ctrl.$$router) || rootRouter;
      if (!router) {
        return;
      }
  
      var link = attrs.ngLink || '';
      var parts = link.match(LINK_MICROSYNTAX_RE);
      var routeName = parts[1];
      var routeParams = parts[2];
      var url;
  
      if (routeParams) {
        var routeParamsGetter = $parse(routeParams);
        // we can avoid adding a watcher if it's a literal
        if (routeParamsGetter.constant) {
          var params = routeParamsGetter();
          url = '.' + router.generate(routeName, params);
          elt.attr('href', url);
        } else {
          scope.$watch(function() {
            return routeParamsGetter(scope);
          }, function(params) {
            url = '.' + router.generate(routeName, params);
            elt.attr('href', url);
          }, true);
        }
      } else {
        url = '.' + router.generate(routeName);
        elt.attr('href', url);
      }
    }
  }