angular - How to specify auxiliary component for child route in angular2 router3 -


i using new route3 , know url syntax specify auxiliary component child route.

i have following child route definition:

const router: routerconfig = [   {     path: 'component-c', component: componentc, children: [       { path: 'auxpath', component: componentaux, outlet: 'aux'},       { path: 'c1', component: componentc1 }     ]   } ]; 

and template componentc like

@component({   selector: 'component-c',   template: `     <div>child route component</div>     <router-outlet></router-outlet>     <router-outlet name="aux"></router-outlet>   `,   directives: [router_directives] }) 

url /component-c/c1 displays componentc1; however, i've tried many combinations /component-c(aux:auxpath)/c1, /component-c/c1(aux:auxpath), etc. , still can't figure out how componentaux displayed...

you should try forming url below.

this.router.navigatebyurl('/component-c/(c1//aux:auxpath) 

as per last investigation current router version has issues in navigating aux outlet using routerlink , navigate method. should build full url , use navigatebyurl.

plunker example. click on detail button , admin. admin routed in admin outlet. open in full screen see url formation.

the url has following semantics

  1. child path separated /
  2. if path has siblings should surrounded parenthesis ()
  3. sibling separated //
  4. outlet , path separated :

    parent/child/(gchild1//outletname:gchild2)

another question


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -