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

bug($ionicHistory): Accessing a view that has already been accessed before $ionicHistory.clearCache() fails #2664

Closed
wesleycho opened this issue Dec 3, 2014 · 9 comments
Assignees
Milestone

Comments

@wesleycho
Copy link

When the user has visited a view, then $ionicHistory.clearCache() runs, any time the user accesses the same view again, it fails to load properly.

@wesleycho
Copy link
Author

The controller appears to re-instantiate properly, but it looks as if the HTML content does not get $compile'd, so the view is busted as a result.

@adamdbradley
Copy link
Contributor

@wesleycho Would you be able to recreate this problem with a codepen? Thanks

@adamdbradley adamdbradley added the needs: reply the issue needs a response from the user label Dec 5, 2014
@wesleycho
Copy link
Author

Will do tomorrow - I did more investigation, and it may be related to the scroll directive compiling twice & an isolate scope breaking the normal inheritance, so that the isolate scope is inheriting instead of the normal one.

@adamdbradley
Copy link
Contributor

I've been unable to replicate this issue, a codepen replicating this issue would help me debug. Thanks

@adamdbradley adamdbradley self-assigned this Dec 7, 2014
@mikemintz
Copy link

This reproduces for me as well. Here is a codepen: http://codepen.io/anon/pen/ZYpqPG

When you click on the second tab, AboutTabCtrl calls $ionicHistory.clearCache(). If you click back to the first tab, the content does not display. If you comment out $ionicHistory.clearCache(), the example works fine.

@rickyk586
Copy link

+1

@Ionitron Ionitron removed the needs: reply the issue needs a response from the user label Jan 19, 2015
@seronal
Copy link

seronal commented Jan 26, 2015

Any updates on this issue? as @wesleycho suggested, this seems to have to do with scroll directive as it can be seen in the codepen @mikemintz provided. After coming back to first tab, the content is actually there but it is scrolled out of view. If you pull the view down, you can see the content.

@willyboy
Copy link

Same issue. I'm using bindonce so if a user logs out of my app, I need to clear the cache so a new user can log in. But when they do and go to the same pages, I run into this problem.

@willyboy
Copy link

Addendum: It appears that this may be related to calling clearCache/clearHistory while a slide is transitioning. If I wrap the clearCache call in a timeout, things work as expected. So this doesn't work:
$state.go("sign-in-email");
$ionicHistory.clearHistory();
$ionicHistory.clearCache();

while this does:
$state.go("sign-in-email");
$timeout(function(){
$ionicHistory.clearHistory();
$ionicHistory.clearCache();
},5000);

@adamdbradley adamdbradley added this to the 1.0.0-rc0 milestone Feb 10, 2015
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants