***************************************************************************
mdNavItem
*************************************************************************** 
@ngdoc directive
@name mdNavItem
@module material.components.navBar

@restrict E

@description
`<md-nav-item>` describes a page navigation link within the `<md-nav-bar>` component.
It renders an `<md-button>` as the actual link.

Exactly one of the `md-nav-click`, `md-nav-href`, or `md-nav-sref` attributes are required
to be specified.

@param {string=} aria-label Adds alternative text for accessibility.
@param {expression=} md-nav-click Expression which will be evaluated when the
link is clicked to change the page. Renders as an `ng-click`.
@param {string=} md-nav-href url to transition to when this link is clicked.
Renders as an `ng-href`.
@param {string=} md-nav-sref UI-Router state to transition to when this link is
clicked. Renders as a `ui-sref`.
@param {string=} name The name of this link. Used by the nav bar to know
which link is currently selected.
@param {!object=} sref-opts UI-Router options that are passed to the
`$state.go()` function. See the [UI-Router documentation for details]
(https://ui-router.github.io/docs/latest/interfaces/transition.transitionoptions.html).

@usage
See `<md-nav-bar>` for usage.
 ***************************************************************************
IMPLEMENTATION                             *
***************************************************************************
function MdNavBar($mdAria, $mdTheming) {
  return {
    restrict: 'E',
    transclude: true,
    controller: MdNavBarController,
    controllerAs: 'ctrl',
    bindToController: true,
    scope: {
      'mdSelectedNavItem': '=?',
      'mdNoInkBar': '=?',
      'navBarAriaLabel': '@?',
    },
    template:
      '<div class="md-nav-bar">' +
        '<nav role="navigation">' +
          '<ul class="_md-nav-bar-list" ng-transclude role="listbox" ' +
            'tabindex="0" ' +
            'ng-focus="ctrl.onFocus()" ' +
            'ng-keydown="ctrl.onKeydown($event)" ' +
            'aria-label="{{ctrl.navBarAriaLabel}}">' +
          '</ul>' +
        '</nav>' +
        '<md-nav-ink-bar ng-hide="ctrl.mdNoInkBar"></md-nav-ink-bar>' +
      '</div>',
    link: function(scope, element, attrs, ctrl) {
      $mdTheming(element);
      if (!ctrl.navBarAriaLabel) {
        $mdAria.expectAsync(element, 'aria-label', angular.noop);
      }
    },
  };
}