angular 2 named router-outlet not working -


i using named router-outlet render component data. named router-outlet in app component main router-outlet.

here outlet:

<router-outlet name="popup"></router-outlet> 

here route-config:

    { path: 'contact', component: contactcomponent },   { path: 'contact-list', component: contactlistcomponent },   { path: 'contact-hold/:id', component: contactoperationcomponent, outlet: 'popup' }, 

and here link:

<a [routerlink]="['\',{outlets:{popup:['hold',1]}}]">hold</a> 

route debugger image

it worked when changed route config. new problem coming cant passed parameter aux url.

here trying parameter router in hold component:

this.route.queryparams.subscribe(params=> {             console.log(params["id"]);     })   

this sample code related question :

before open popup. url image shown below

enter image description here

component.html

<button type="submit" [routerlink]="['/', { outlets: { popup: 'product-family/'+ productfamily.id + '/delete'} }]" replaceurl="true" class="btn btn-danger btn-sm"> <span class="fa fa-remove"></span> <span class="hidden-md-down">delete</span> 

route.ts

export const productfamilypopuproute: routes = [     {         path: 'product-family/:id/delete',         component: productfamilydeletepopupcomponent,         outlet: 'popup'     } ]; 

after click delete button url changed show below image:

enter image description here


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -