mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Previously the showBack property was setting if the back button should or should not be enabled, and it was also used if the back button should be hidden or not for the view. Changed it so there are now two concepts, where showBack is visual only, and enableBack determines if it should show according to $ionicHistory and navigation info.
74 lines
1.9 KiB
JavaScript
74 lines
1.9 KiB
JavaScript
|
|
/**
|
|
* @ngdoc service
|
|
* @name $ionicNavBarDelegate
|
|
* @module ionic
|
|
* @description
|
|
* Delegate for controlling the {@link ionic.directive:ionNavBar} directive.
|
|
*
|
|
* @usage
|
|
*
|
|
* ```html
|
|
* <body ng-controller="MyCtrl">
|
|
* <ion-nav-bar>
|
|
* <button ng-click="setNavTitle('banana')">
|
|
* Set title to banana!
|
|
* </button>
|
|
* </ion-nav-bar>
|
|
* </body>
|
|
* ```
|
|
* ```js
|
|
* function MyCtrl($scope, $ionicNavBarDelegate) {
|
|
* $scope.setNavTitle = function(title) {
|
|
* $ionicNavBarDelegate.title(title);
|
|
* }
|
|
* }
|
|
* ```
|
|
*/
|
|
IonicModule
|
|
.service('$ionicNavBarDelegate', delegateService([
|
|
/**
|
|
* @ngdoc method
|
|
* @name $ionicNavBarDelegate#align
|
|
* @description Aligns the title with the buttons in a given direction.
|
|
* @param {string=} direction The direction to the align the title text towards.
|
|
* Available: 'left', 'right', 'center'. Default: 'center'.
|
|
*/
|
|
'align',
|
|
/**
|
|
* @ngdoc method
|
|
* @name $ionicNavBarDelegate#showBackButton
|
|
* @description
|
|
* Set/get whether the {@link ionic.directive:ionNavBackButton} is shown
|
|
* (if it exists and there is a previous view that can be navigated to).
|
|
* @param {boolean=} show Whether to show the back button.
|
|
* @returns {boolean} Whether the back button is shown.
|
|
*/
|
|
'showBackButton',
|
|
/**
|
|
* @ngdoc method
|
|
* @name $ionicNavBarDelegate#showBar
|
|
* @description
|
|
* Set/get whether the {@link ionic.directive:ionNavBar} is shown.
|
|
* @param {boolean} show Whether to show the bar.
|
|
* @returns {boolean} Whether the bar is shown.
|
|
*/
|
|
'showBar',
|
|
/**
|
|
* @ngdoc method
|
|
* @name $ionicNavBarDelegate#title
|
|
* @description
|
|
* Set the title for the {@link ionic.directive:ionNavBar}.
|
|
* @param {string} title The new title to show.
|
|
*/
|
|
'title',
|
|
|
|
// DEPRECATED, as of v1.0.0-beta14 -------
|
|
'changeTitle',
|
|
'setTitle',
|
|
'getTitle',
|
|
'back',
|
|
'getPreviousTitle'
|
|
// END DEPRECATED -------
|
|
]));
|