I have a nav bar and I want to add a save button to the nav bar for only one screen. I was reading the blogs and everyone was saying how you declare your buttons in the view and don't access them in a controller. That is all well and good but I have to imagine people still want to hide and show nav buttons. Am I missing something?
<body ng-app="App">
<!-- The nav bar that will be updated as we navigate -->
<ion-nav-bar class="bar-positive">
<ion-nav-back-button> </ion-nav-back-button>
<ion-nav-buttons side="right">
<button id="saveButton" class="button button-clear">Save</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view></ion-nav-view>
</body>
You can add buttons on left or right side in navigation bar from any screen containing <ion-view>
.Like
<ion-view title="New Screen">
<ion-nav-buttons side="primary">
<button class="button" ng-click="doSomething()">
New Button
</button>
</ion-nav-buttons>
</ion-view>
So this "New Button" will only come for "New Screen".
In case you just want to hide right nav button on that perticular. You can do it with
<ion-nav-buttons side="right" >
</ion-nav-buttons>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With