Lazy loading and using named outlets. I have gotten the named outlet to load as expected but when it does, it is also clearing the primary outlet. I want the primary outlet to keep the component it is displaying and just the named outlet to change to show new component.
Thanks to some help from @pixelbits... here is an example of what is not working https://stackblitz.com/edit/angular-sw6cmc
I don't want the primary outlet to change.
The html
<router-outlet></router-outlet>
<router-outlet name="dialogOutlet"></router-outlet>
The route:
{
path: 'packoutdialog'
, children:[
{path:'', outlet:'dialogOutlet', component: PackoutComponent}]
},
Either of these will fill the dialogOutlet but clear the primary
this.router.navigate(['inventory', 'packoutedialog'])
this.router.navigate(['packoutdialog',{outlets:{'dialogOutlet':[]}}],{skipLocationChange: true, relativeTo: this.activatedRoute.parent});
This seems like it should work but does not.
this.router.navigate([{outlets:{'dialogOutlet':['inventory','packoutdialog']}}])
the expected result is that the primary router-outlet keeps the view in it and only the named outlet changes. Currently the named outlet is changing as expected but the primary outlet is getting cleared.