why is it after I fill up the necessary inputs then send to my server after sending I redirect user to some other page. When a user went back to that page, the info he filled still present in there. How can I fix this? It seems the info I filled is cached when in fact I didn't use such technology in my application. How can I clear the input data done before?
Asked
Active
Viewed 4,125 times
1 Answers
8
In the latest ionic release (v1.0.0-beta.14) they introduced view caching. See IonView docs for more infos on that.
You could deactivate caching in for your route like this
.state('your.state', {
url: '/your/url',
cache: false,
views: {
// ...
}
})
or directly in your view
<ion-view cache-view="false" view-title="My Title!">
See ionNavView docs
Or you might even want to disable cache globally for testing:
$ionicConfigProvider.views.maxCache(0);

tmaximini
- 8,403
- 6
- 47
- 69
-
Is this applicable on the main html ? I want to put it on
so all other html inherit this. – user3569641 Feb 01 '15 at 11:27 -
not sure if I get you question? The first is used per-route in app.js, the second approach can be used for each
directive. The 3rd approach would disable cache globally. – tmaximini Feb 01 '15 at 11:34 -
`
` works for me. I think i should use this globally using your third approach cause I might need to add new page and forgot to disable cache-view. Thanks! – user3569641 Feb 01 '15 at 11:37