$ionicNavBarDelegate

Delegate for controlling the ionNavBar directive.

Usage

<body ng-controller="MyCtrl">
  <ion-nav-bar>
    <button ng-click="setNavTitle('banana')">
      Set title to banana!
    </button>
  </ion-nav-bar>
</body>
function MyCtrl($scope, $ionicNavBarDelegate) {
  $scope.setNavTitle = function(title) {
    $ionicNavBarDelegate.title(title);
  }
}

Methods

align([direction])

Aligns the title with the buttons in a given direction.

Param Type Details
direction
(optional)
string

The direction to the align the title text towards. Available: 'left', 'right', 'center'. Default: 'center'.

showBackButton([show])

Set/get whether the ionNavBackButton is shown (if it exists and there is a previous view that can be navigated to).

Param Type Details
show
(optional)
boolean

Whether to show the back button.

  • Returns: boolean Whether the back button is shown.

showBar(show)

Set/get whether the ionNavBar is shown.

Param Type Details
show boolean

Whether to show the bar.

  • Returns: boolean Whether the bar is shown.

title(title)

Set the title for the ionNavBar.

Param Type Details
title string

The new title to show.