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>
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
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:
Comments
Post a Comment