This commit is contained in:
Max Lynch
2013-12-04 15:55:53 -06:00
parent 4c0e82e782
commit a83b57305f
5 changed files with 42 additions and 5 deletions

View File

@@ -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