mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Fixed #254
This commit is contained in:
12
js/ext/angular/src/directive/ionicNavRouter.js
vendored
12
js/ext/angular/src/directive/ionicNavRouter.js
vendored
@@ -283,6 +283,13 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
}
|
||||
});
|
||||
|
||||
// If a nav page changes the left or right buttons, update our scope vars
|
||||
$scope.$parent.$on('navRouter.leftButtonsChanged', function(e, data) {
|
||||
$scope.leftButtons = data;
|
||||
});
|
||||
$scope.$parent.$on('navRouter.rightButtonsChanged', function(e, data) {
|
||||
$scope.rightButtons = data;
|
||||
});
|
||||
|
||||
/*
|
||||
$scope.$parent.$on('navigation.push', function() {
|
||||
@@ -333,7 +340,7 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
$scope.$watch(leftButtonsGet, function(value) {
|
||||
$scope.leftButtons = value;
|
||||
if($scope.doesUpdateNavRouter) {
|
||||
$scope.$emit('navRouter.leftButtonsChanged', $scope.rightButtons);
|
||||
$scope.$emit('navRouter.leftButtonsChanged', $scope.leftButtons);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -341,6 +348,9 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
|
||||
var rightButtonsGet = $parse($attr.rightButtons);
|
||||
$scope.$watch(rightButtonsGet, function(value) {
|
||||
$scope.rightButtons = value;
|
||||
if($scope.doesUpdateNavRouter) {
|
||||
$scope.$emit('navRouter.rightButtonsChanged', $scope.rightButtons);
|
||||
}
|
||||
});
|
||||
|
||||
// watch for changes in the title
|
||||
|
||||
Reference in New Issue
Block a user