diff --git a/js/angular/directive/view.js b/js/angular/directive/view.js index 7721c54b4ea..bf39433556f 100644 --- a/js/angular/directive/view.js +++ b/js/angular/directive/view.js @@ -59,15 +59,19 @@ IonicModule } - $scope.$watch($attr.hideBackButton, function(value) { - // Should we hide a back button when this tab is shown - navBarCtrl.showBackButton(!value); - }); + if (angular.isDefined($attr.hideBackButton)) { + $scope.$watch($attr.hideBackButton, function(value) { + // Should we hide a back button when this tab is shown + navBarCtrl.showBackButton(!value); + }); + } - $scope.$watch($attr.hideNavBar, function(value) { - // Should the nav bar be hidden for this view or not? - navBarCtrl.showBar(!value); - }); + if (angular.isDefined($attr.hideNavBar)) { + $scope.$watch($attr.hideNavBar, function(value) { + // Should the nav bar be hidden for this view or not? + navBarCtrl.showBar(!value); + }); + } }; }