What is the difference between $ionicView.enter and cache:false

前端 未结 2 701
臣服心动
臣服心动 2020-11-29 10:25

I\'m developing a view that need call multiples methods of a webservice every time the view is opened, should i use $scope.$on(\'$ionicView.enter\', function(){...})

2条回答
  •  鱼传尺愫
    2020-11-29 10:57

    $ionicView.enter is an event that is broadcasted each time the selected view is activated.

    cache:false means that the page will never be cached, and is therefore, reloaded completely each time.

    I personnaly try to avoid using cache false as it as bad performances but has side effects as your controller won't be initialised again when you are back on it.

    Instead, when I enter a view, I user $ionicView.enter or $ionicView.afterEnter to trigger several actions for page to completly finished the loading.

提交回复
热议问题