The back button is broken and I cannot for the life of me fix it


#1

Can’t for the life of me figure out why the back button doesn’t show up when I navigate to an <ion-view>

app base state template:

<ion-side-menus>
  <ion-side-menu side="left">
    <div class="list">
    <!-- ... -->  
    </div>
  </ion-side-menu>
  <ion-side-menu-content state>
    <ion-nav-bar class="bar-positive">
      <ion-nav-back-button></ion-nav-back-button>
    </ion-nav-bar>

    <!-- Content -->
    <ion-nav-view></ion-nav-view>

  </ion-side-menu-content>
</ion-side-menus>

Then, I have two simple views, one that gets loaded on app start and one that is linked from it with an ui-sref.

Default app.entries state template:

<ion-view title="Entries">
    <a ui-sref="app.entryDetails({ entryId: entry._id })" ng-repeat="entry in entryList"> {{entry.title}} </a>
</ion-view>

app.entryDetails state template:

<ion-view title="{{entry.title}}">
    Testing.
</ion-view>

And in the end, THIS is what happens. Any ideas on what’s going on here?


#2
  1. Wrap your content with ion-content when putting it in ion-view or ion-modal-view

  2. Why are you using ui-sref? I would use ng-click
    Let the ng-click call a function goToEntry(entry ._I’d)
    And let the function be:

$scope.goToEntry = function (id) { $state.go(app.entryDetails, {entryId: entry.id}); }


#3

Hey, thanks for your advice! Unfortunately it doesn’t solve the problem.