Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(viewLifecycle): move event emit after transition cleanup #4715

Closed
wants to merge 3 commits into from

Conversation

mlynch
Copy link
Contributor

@mlynch mlynch commented Dec 5, 2015

Right now view lifecycle events can fire before the transition is fully cleaned up, meaning our past view can be in a leaving state instead of cached when the new view's $ionicView.enter is triggered.

This fixes #2939 where this code would not correctly clear the last view because it is marked leaving rather than cached in the navViewController.clearCache function:

controller('MyCtrl', function() {
  $scope.$on('$ionicView.enter' function() {
    $ionicHistory.clearCached();
  });
});

The fix was to move the event emit to the bottom of transitionCompleted in viewSwitcher.js

@mlynch
Copy link
Contributor Author

mlynch commented Dec 5, 2015

Yea some of the tests are failing and need to be fixed

@mlynch mlynch closed this Dec 5, 2015
@mlynch
Copy link
Contributor Author

mlynch commented Dec 5, 2015

Landed 06ef682

@adamdbradley adamdbradley deleted the 2939-view-events branch April 21, 2016 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Add a method to empty/flush Cached Views
1 participant