Angular / Ionic - controller only runs once

前端 未结 5 1681
無奈伤痛
無奈伤痛 2021-02-20 18:57

I\'m starting out with Angular through the Ionic Framework but I am failing to understand why the controller only runs once i.e. I change state, the controller runs, change to a

5条回答
  •  孤城傲影
    2021-02-20 19:15

    You don't need to disable entire app cache. If you want to re-run controller every time you enter on it you should clear cache before you leave it:

     $scope.$on("$ionicView.afterLeave", function () {
             $ionicHistory.clearCache();
     }); 
    

提交回复
热议问题