重装:真正的工作只有一次 [英] reload: true works only once
本文介绍了重装:真正的工作只有一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图从一个视图参数传递给另一个我anulgar /离子应用程序。
I am trying to pass parameters from one view to another in my anulgar/ionic app.
在 volCompute
视图($ stateParams声明):
in the volCompute
view ($stateParams is declared):
if ($stateParams.modelLine){
console.log('receiving', $stateParams.modelLine.id, $stateParams.modelLine.modelStrict)
$scope.data.chosenModel = $stateParams.modelLine.modelStrict;
}
在比较
查看:
$state.go('app.volCompute', { modelLine: test[0] }, {reload: true});
但它的作品只有一次,如果我来回走了两个视图code之间的 volCompute
未运行。
这似乎是重装:真正的
只执行一次
您可以帮忙吗?
推荐答案
有一些细节如何理解离子缓存
There are few more details how to understand ionic caches
- What is the difference between $ionicView.enter and cache:false
- ui.router not reloading controller
和我会建议在这里使用的事件钩子 $ ionicView.enter
或 $ ionicView.afterEnter
And I would suggest to use the event hook here $ionicView.enter
or $ionicView.afterEnter
$scope.$on('$ionicView.enter', function(){
// Coding
});
还有就是文档链接
这篇关于重装:真正的工作只有一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文