Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular2 ComponentRouter prevent automatic component reuse [duplicate]

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?

like image 673
prupp81 Avatar asked Nov 09 '22 11:11

prupp81


1 Answers

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

like image 118
Günter Zöchbauer Avatar answered Nov 15 '22 12:11

Günter Zöchbauer