In my Ionic Angular app, using angular-ui-router,
I was wondering how to make one custom back button for all the app's views, as I want every back button to be the same and to link to the same page.
My index page looks like this:
<ion-nav-bar class="bar-stable bar-positive">
<ion-nav-back-button>
</ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view></ion-nav-view>
But the problem is changing
<ion-nav-back-button>
</ion-nav-back-button>
won't do the trick, as these get automaticly updated when a new page is entered. Would there be a way to prevent this changing?
I don't know what custom directives you are using, but to create a link to specific view in any page of your app using pure AngularUI Router - you can use ui-sref attribute, the syntax then is as follows:
<a ui-sref="{YOUR_STATE_NAME}" ui-sref-opts="{OPTIONAL_PARAMS}">link</a>
<!--it can be also a <button>-->