5
私は角度2のアプリケーションを持っており、ルートイベントを傍受し、起こらないようにし、アニメーションを再生してからルートを継続したいと考えています。角度2経路イベントをインターセプトして後でルーティングする
私の考えは、私はクラス
export class SomeComponent {
constructor(private router: Router){
router.events.subscribe(evt => {
if(evt instanceof NavigationStart){
//I would like to cancel the event here the first time, and then
//play an animation, after the animation is done, trigger the router
//to go to the original route it wanted to.
}
})
}
}
を持っている場合は、ナビゲーション処理を終えたから、そのルータを停止する方法があります。この
ですか?
URLに '?showAnimation'のようなものを追加できますか?URLの変更が発生するたびに、そのフラグがあるかどうかを確認し、そうであれば元のルートのアドレスに移動する前にアニメーションを行いますか? – Pytth