2
votes

My problem is that, despite using ion-nav-title my nav bar title isn't updating when coming from a child state from ui-sref.

But the nav bar updates fine when coming from a parent state.

I've followed this tutorial to improve the default Slide Menu example: http://robferguson.org/2015/01/07/ionics-sidemenu-template-and-nested-states/

Now my back button is a custom one

<ion-nav-buttons side="left">
    <button class="button button-icon button-clear" ui-sref="app.events.detail.subevents({eventId : eventDetails._id})">
        <i class="icon ion-arrow-left-c"></i>
    </button>
</ion-nav-buttons>

<ion-nav-title>
    <span ng-bind="subEventDetails.eventTitle"></span>: Participants
</ion-nav-title>

Here's a plnkr to show my issue. It demoes 3 level of nested view; Event, Sub Events, Participants.

Scenario:

  1. slide menu; Events
  2. Title shows "List of Events", the title is correct
  3. pick event 1 to see its sub events
  4. Title shows "Event 1: List of sub events", the title is updated correctly
  5. pick sub event 1
  6. Title shows "SubEvent 1: List of Participants", the title is updated correctly
  7. Go Back and the title will not change, it should revert back to "Event 1: List of sub events" but shows "SubEvent 1: List of Participants" instead. Note that the sub Events are displayed nevertheless...

Also, the problem doesn't happen when going back from step 3, because I'm not using a dynamic ion-nav-title but a static ion-view title.

Hope someone has come accros this problem before, before I need the title to be dynamic.

Thanks for your help

1

1 Answers

3
votes

answer from Ionic Forum http://forum.ionicframework.com/t/ionic-ion-nav-title-not-updating/30731

The solution is to disable cache on the abstract views, responsible for the Tabs views.