Angular2 ComponentRouter prevent automatic component reuse [duplicate]

三世轮回 提交于 2019-12-23 15:06:18

问题


Documentation https://angular.io/docs/ts/latest/guide/router.html states

... 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?


回答1:


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

See also the discussion in https://github.com/angular/angular/issues/9811

That's now fixed by https://github.com/angular/angular/pull/13124

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



来源:https://stackoverflow.com/questions/38786246/angular2-componentrouter-prevent-automatic-component-reuse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!