Skip to content

$ionicHistory.clearCache() now returns promise so you can ensure cache is cleared …#3724

Closed
abcd-ca wants to merge 1 commit intoionic-team:masterfrom
abcd-ca:master
Closed

$ionicHistory.clearCache() now returns promise so you can ensure cache is cleared …#3724
abcd-ca wants to merge 1 commit intoionic-team:masterfrom
abcd-ca:master

Conversation

@abcd-ca
Copy link
Copy Markdown

@abcd-ca abcd-ca commented May 13, 2015

Enables promise chaining. Otherwise in the example below, cache would not be clear before $state.go call and app.home would not update.

Example:

// In PreferencesCtrl:
$scope.clearCache().then((function() {
  return knetAccountHelper.updateSettings('preferences');
})).then((function() {
  return $state.go('app.home')
}));

Note, app.home is caching its view by default (I have not set cache:false in its state definition). In the scenario above, I want app.home to be cached in most cases except after leaving my preferences view which affects what is displayed at app.home.

…before using .go when navigating to a cached view. Before, cache wouldn't be cleared before view was navigated to)
@perrygovier perrygovier added this to the 1.0.1 milestone May 14, 2015
@chrfritsch
Copy link
Copy Markdown

+1 Need that so much. Please merge. Works fine

@mhartington mhartington modified the milestones: 1.0.2, 1.0.1 Jun 23, 2015
@alejandromagnorsky
Copy link
Copy Markdown

+1. So important feature

Whiskey24 added a commit to Whiskey24/GoingDutchApp that referenced this pull request Jul 20, 2015
This pull request is not in yet: ionic-team/ionic-framework#3724
@echizen
Copy link
Copy Markdown

echizen commented Jul 22, 2015

+1. otherwise i can't find a good way to go back and refresh page

@jackyon
Copy link
Copy Markdown

jackyon commented Jul 30, 2015

+1

2 similar comments
@adrienkohlbecker
Copy link
Copy Markdown

👍

@ghost
Copy link
Copy Markdown

ghost commented Aug 7, 2015

👍

@mhartington
Copy link
Copy Markdown
Contributor

Thanks @abcd-ca, merged in via 336c388

@dotnet54
Copy link
Copy Markdown

bump, much needed feature

@rinogo
Copy link
Copy Markdown

rinogo commented Nov 15, 2016

Thanks so much, @abcd-ca! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

10 participants