Angular2 ComponentRouter prevent automatic compone

2019-06-24 00:16发布

This question already has an answer here:

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条回答
乱世女痞
2楼-- · 2019-06-24 00:34

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

查看更多
登录 后发表回答