0
我认为$state.reload()
是异步运行的,我怎么能在执行代码之前等待它呢?
一样,
$state.reload(); futureFunc();
$state.reload().then(futureFunc);
不会为我工作。
我认为$state.reload()
是异步运行的,我怎么能在执行代码之前等待它呢?
一样,
$state.reload(); futureFunc();
$state.reload().then(futureFunc);
不会为我工作。
你将得到一个回调$ state.go
所以,做这样的事情
$state.go('wherever', {whenever: 'whatever'}).then(function() {
// Get in a spaceship and fly to Jupiter, or whatever your callback does.
});
未来是不确定的 –
@RomanC我已经更新。谢谢。 – xxx222
为什么你应该等待,如果它异步? –