Ionic view clear template cache

Ionic view clear template cache
Ionic view clear template cache

Ionic view clear template cache without cache:false. Facing ionic caching issues for ignore template cache partially or ionic clear/refresh cached view. Use ionicView beforeEnter event in controller for clear cache data before entering to view.

When cache parameter true for view by ion-nav-view state provider or cache-view attribute, Ionic will display full view content from cached copy on second visit.

If you want to refresh selected view section in cached template use ionicView beforeEnter event with below steps.

Ionic view clear template cache steps

Step No. Steps
1 Decide no cache scope data
2 Add ionicView beforeEnter event in controller
3 Set fresh step 1 scope data in event function
4 Use data normally in template

Ionic ionicView beforeEnter event example:

.controller('MyCtrl', function($scope) {
    $scope.$on("$ionicView.beforeEnter", function() {
        //set fresh content in scope variable
    });
})