Angular 2 子路由会刷新父路由吗 [英] Will Angular 2 child routes refresh the parent route

查看:41
本文介绍了Angular 2 子路由会刷新父路由吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,在某些情况下,我在父路由的子级之间路由.一个看起来像 example.com/a/1/ 另一个 example.com/a/2/ 将从 1 切换到 2 触发页面a 的重新加载/渲染?

I have an application in which I route between children of a parent route in some situations. One will look like example.com/a/1/ another example.com/a/2/ will switching from 1 to 2 trigger a reload/render of the page a?

就像在 a 中播放视频并且有一个路由出口作为该视频的兄弟,这种页面变化会触发视频重新加载吗?

Like playing a video in a and have a routes outlet as sibling to that video, will this change of page trigger the video to reload?

如果是这样,可以防止这种情况发生吗?

If so, can this be prevented?

推荐答案

不,不会.父组件只有在您离开它然后再次导航到它时才会刷新.

No, it won't. The parent component will only be refreshed if you navigate away from it and then navigate to it again.

这篇关于Angular 2 子路由会刷新父路由吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆