Angular 2: Swapping between different components without destroying them

后端 未结 2 1732
不知归路
不知归路 2020-12-28 17:42

I\'m trying to build a window manager with Angular 2. Basically, I want to be able to swap between windows (that are components injected in a router outlet) without losing t

2条回答
  •  北海茫月
    2020-12-28 18:24

    Checkout canReuse on the router: canReuse in angular2 api docs

    If you specify it the router wont destroy your component when switching away from it.

提交回复
热议问题