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
爲什麼你應該等待,如果它異步? –