[英]How can I execute codes after $state.reload() is called in Angular JS?
I think $state.reload()
is ran asynchronously, how can I wait it to be done before executing code after it? 我认为
$state.reload()
是异步运行的,如何在它之后执行代码之前等待它完成?
Like, 喜欢,
$state.reload(); futureFunc();
$state.reload().then(futureFunc);
does not work for me. 对我不起作用。
You will get callback in $state.go 您将在$ state.go中获得回调
So, do something like this 所以,做这样的事情
$state.go('wherever', {whenever: 'whatever'}).then(function() {
// Get in a spaceship and fly to Jupiter, or whatever your callback does.
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.