問題タブ [angular-route-guards]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
angular - 最終結果が true の場合、Angular Router Guard が解決されない
次のコードは、最後の if ステートメントが true の場合に正しく機能します。最後の if ステートメントが false の場合、要求されたルートを解決しません。awaits と asyncs を追加してみました。ブール値で await を返す別の関数にコードを移動しようとしましたが、必要なときにルートを解決するために何も機能していません。設定へのリダイレクトを拒否する必要がある場合は常に機能します。
If ステートメント
完全なルーター ガード