加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Angular2 ComponentRouter阻止自动组件重用

发布时间:2020-12-17 17:07:29 所属栏目:安全 来源:网络整理
导读:参见英文答案 Angular2 Routing – keeping state of component when route changes ????????????????????????????????????2个 文件 https://angular.io/docs/ts/latest/guide/router.html指出 … By default,the router reuses a component instance when i
参见英文答案 > Angular2 Routing – keeping state of component when route changes ????????????????????????????????????2个
文件 https://angular.io/docs/ts/latest/guide/router.html指出

… By default,the router reuses a component instance when it re-navigates to the same component type without visiting a different component first. The parameters can change between each re-use…

但没有提示如何更改此默认行为.

是否可以防止重复使用?

解决方法

目前不支持此功能.有计划在下一个版本之一中添加对某些可配置性的支持.

另见https://github.com/angular/angular/issues/9811中的讨论

现在由https://github.com/angular/angular/pull/13124确定

另见https://www.softwarearchitekt.at/post/2016/12/02/sticky-routes-in-angular-2-3-with-routereusestrategy.aspx

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读