問題タブ [angular2-router]
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.
javascript - リフレッシュルートでは、angular2ルーターを使用してデフォルトルートに向けています
アプリケーションのルーティングを構成するために angular2 ルーターを使用しています。これが私のコード スニペットです。
header.component.html
header.component.ts
index.html
これは app.module.ts での私のルーティングです。changepassword ルートに移動した後、私の URL はhttp://localhost:4200/#/changepassword になります。ページを更新したり、この URL を新しいタブで開いたりすると、URL はhttp://localhost:4200/#/dashboard (デフォルト ルート) にリダイレクトされます。
ページを更新した後に同じルートを取得する必要があります。または、別のタブにルートをコピーして貼り付ける場合は、対応するルートを取得する必要があります。
私を助けてください。前もって感謝します。