Upgrade from Beta 13 (Angular 1.2) to Beta 14 (Angular 1.3) is painfull


#1

I have a side-menus based ionic app. Everything went pretty well with Beta 13, but after upgrading, here are the problems I noticed:

  1. During nav, "Back"button displays but it should not (nav-clear).
  2. When going from one page to another with a form, if the form had already been filled before, I get back the data. Exemple: when I log out, I’m redirected to log in page, but with the username/password fields filled (pretty annoying…).
  3. Other unstabilities hard to describe (freeze)
  4. Transitions are noticeably slower (using my Nexus 4 to test).

I know you can’t solve these problems without the code, but did you experience similar issues? Do you think the problems could come from my code that would be compatible with AngularJS 1.2 but not 1.3? (edit: I just noticed that sidemenu seed app from ionic has been updated to be compatible with beta 14…)
I’m thinking of rolling back to beta 13 / Angular 1.2

Thanks.


#2

I’ll take a shot at helping with this.

  1. I’m not sure what the nav-clear means, but there are a few ways to hide the back button
  • If you want to hide the back button all the time you shouldn’t include <ion-nav-back-button></ion-nav-back-button> in the ion-nav-bar.
  • If you want to conditionally hide the back button based on the view you can add hide-back-button="true" to the <ion-view> tag.
  • If you are only talking about the word “back” showing, you can modify the back button using $ionicConfigProvider, e.g. in the Angular config $ionicConfigProvider.backButton.previousTitleText(false).text('');
  1. This is being caused by the cached views introduced in beta 14.
  • If you don’t want any of your views to be cached you can set the maxCache to 0. Again this goes in the config: $ionicConfigProvider.views.maxCache(0);
  • If you want to cache some views but not all you can set the attribute in the state config or on
    the ion-view. See the caching section for ionNavView.
  • If you want to continue to cache the view, but just clear the form data you could add the code to clear the form before entering the view in the controller:
    $scope.$on('$ionicView.beforeEnter', function() { // Clear form data here });

3.Not sure what this means.
4.The only slow transitions I’ve noticed have been with the modal opening/closing, but I think that is caused by something in my code.

Hope that helps, sorry if I misunderstood any of it!


#3

Thanks a lot your your detailed answer. Actually I rollbacked to the beta 13 so it’s difficult to test all you said, but I’m sure it will help me when I will upgrade, and for other people too.


#4

I’d like to use the caching but how do I clear the entire cache when a user logs out so the new user does not see anything from the prior user?


#5

There have been a few topics on this. I haven’t personally done anything like this, but other users have run into problems with this. There are issues opened for it.


#6

@walt, can you provide a codepen? Did you used to have a header contained inside your ion-view’s? if so, that has been significantly refactored and your nav layout including back button should all be in your index. The only thing you should be overriding in separate views are nav-buttons containers. If you provide a codepen we could probably quickly point out whats going on.