FrozenPandaz/ng-hydration-renderer

Handle Router Outlets

Closed this issue · 2 comments

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request

Current behavior
The Router Outlet will create a new Activated Component even one exists

Expected behavior
The Router Outlet should just use the preserved component

Minimal reproduction of the problem with instructions

<router-outlet></router-outlet>
@NgModule({
  imports: [
    RouterModule.forRoot([{
      path: '',
      component: RoutedComponent
    }]);
  ]
})
export class AppRoutingModule {}

@Component({
  selector: 'app-route-view',
  template: '<h1 ng-preserve-node>Preserved</h1>
})
export class RoutedComponent {}

What is the motivation / use case for changing the behavior?
Users should be able to preserve within routed views

Please tell us about your environment:
N/a

  • Angular version: 2.0.X
    2.4.7

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    All

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    Typescript

Thank you @alxhub for the hackaround suggestion