ionic 1 cache controller clear or reload

Issue

Hi I have a application in Ionic, it is 4 screen, and want refresh the controller when go from one view to another.
but above all my problem lies in this controller:

enter image description here

as you can see, what you see on the top right is the time, when it arrives a zero, finish the game and go to next page, but if i press in the previous view before the time runs out, the time (variable) the time keeps running, as if it were still in the same controller, and when it reaches 0 it takes me to the last page which I should not do, because this only does it from the page I show above. Also, it is in the view of the image, its controller calls some sounds when certain actions are executed, and even so, if I leave the view and its controller and I go to another, those sound are still running. I already tried several ways that I saw to clean cache, but none works.

$ionicHistory.clearCache().then(function(){ $state.go('firstState');});
$state.go('firstState', {}, {reload: true});
$state.transitionTo('firstState', null, {reload: true});
.state('categorias',{
    cache       :  false,
    url         : '/categorys', 
    templateUrl : 'app/Templates/selectCategory.html',
    controller  : 'categoryController',
    reload      : true

I have tried all this, but nothing works, I’ve tried all this, but nothing works, the only thing it does is clear the view cache but the controllers are still working.
thanks for your help

Solution

use this on pages that you do not want to have cache

cache-view="false"

example

< ion-view title=”login” hide-nav-bar=”true” cache-view=”false” >

Answered By – Rodrigo Guentelican

Answer Checked By – Jay B. (AngularFixing Admin)

Leave a Reply

Your email address will not be published.