Reputation: 311
I want to refresh a page when I click a button (refresh the data in the page, release the cache)
The main page I have a list in my main page. there is a function for change the item on the list. but when I change the item and redirect to main page it show me the previous values until refresh the page, I want to refresh only when I press the button (clear the cache on main page ).
in controller $state.go("app.feed");
I wrote this. how do I change it ?
Upvotes: 4
Views: 6943
Reputation: 4534
Keep "cache-view" attribute in the view, and it will not cache which always load fresh data
<ion-view view-title="Favourite List" cache-view="false">
Upvotes: 0
Reputation: 3429
If you just want to reload the state you can use:
$state.go($app.feed, {}, {reload: true});
$state.go($state.current, {}, {reload: true});
you can refer this page :Clear History and Reload Page on Login/Logout Using Ionic Framework
or
Refer this page:
https://github.com/angular-ui/ui-router/issues/582
Upvotes: 2