Navigate with matrix params:
the router will navigate to /first;name=foo/details
/first;name=foo/details
<a [routerLink]="['/', 'first', {name: 'foo'}, 'details']"> link with params </a>