Angular2 ComponentRouter防止自动重用组件 [英] Angular2 ComponentRouter prevent automatic component reuse

查看:59
本文介绍了Angular2 ComponentRouter防止自动重用组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文档 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...

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

but there is no hint how to change this default-behavior.

是否可以防止重复使用?

Is it possible to prevent the re-use?

推荐答案

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

This is currently not supported. There are plans to add support for some configurability in one of the next versions.

另请参见> https://github.com/angular/angular/issues/9811

现在已由 https://github.com/angular/angular/pull/13124修复

另请参见 查看全文

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