Angular2 canReuse and onReuse are no longer supported

in Angular2 rc5 we used to route through one component with the following router-config

{
       path:      '',
       component: MyComponent
   },
   {
       path:      ':view',
       component: MyComponent,
       data:      this.data
   },
   {
       path:      ':view/:childview',
       component: MyComponent,
       data:      this.data
   },
   {
       path:      ':view/:childview/:subchildview',
       component: MyComponent,
       data:      this.data
   }

now in the final version of Angular2 this is not possible, since the CanReuse and OnReuse interfaces have disappeared.

Now I have a problem switching between different paths.

When I'm on the way, for example

start / startpage

I get to him, but if I head for

start / start / information

the component is used to re-initialize and reuse ...

What can I do to change it?

thank

+4
source share

Source: https://habr.com/ru/post/1656100/


All Articles