function prelink($scope, $element, $attr, navBarCtrl) {
        navBarCtrl._headerBarView = new ionic.views.HeaderBar({
          el: $element[0],
          alignTitle: $attr.alignTitle || 'center'
        });

        $parse($attr.controllerBind || '$ionicNavBarController')
          .assign($scope, navBarCtrl);

        //defaults
        $scope.backButtonShown = false;
        $scope.shouldAnimate = true;
        $scope.isReverse = false;
        $scope.isInvisible = true;
        $scope.$parent.$hasHeader = true;

        $scope.$watch(function() {
          return ($scope.isReverse ? ' reverse' : '') +
            ($scope.isInvisible ? ' invisible' : '') +
            (!$scope.shouldAnimate ? ' no-animation' : '');
        }, function(className, oldClassName) {
          $element.removeClass(oldClassName);
          $element.addClass(className);
        });

      }
@ngdoc directive
@name ionNavBar
@module ionic
@controller ionicNavBar as $scope.$ionicNavBarController
@restrict E

@description
If we have an {@link ionic.directive:ionNavView} directive, we can also create an
`<ion-nav-bar>`, which will create a topbar that updates as the application state changes.

We can add a back button by putting an {@link ionic.directive:ionNavBackButton} inside.

We can add buttons depending on the currently visible view using
{@link ionic.directive:ionNavButtons}.

Assign an [animation class](/docs/components#animations) to the element to
enable animated changing of titles (recommended: 'slide-left-right' or 'nav-title-slide-ios7')

@usage

```html
<body ng-app="starter">
  <!-- The nav bar that will be updated as we navigate -->
  <ion-nav-bar class="bar-positive nav-title-slide-ios7">
  </ion-nav-bar>

  <!-- where the initial view template will be rendered -->
  <ion-nav-view></ion-nav-view>
</body>
```

@param controller-bind {string=} The scope expression to bind this element's
{@link ionic.controller:ionicNavBar ionicNavBar controller} to.
Default: $ionicNavBarController.
@param align-title {string=} Where to align the title of the navbar.
Available: 'left', 'right', 'center'. Defaults to 'center'.