You are confusing route params with query params.
/componentb/:ids will only match on /componentb/1 etc but not /componentb. In this scenario :ids is a ROUTE param, you need a query param.
/componentb/:ids
/componentb/1
/componentb
:ids
You will need to change the route to
const routes: Routes = [ { path: 'componentb', component: componentb } ];
and then navigate as follows
this.router.navigate( ['/componentb'], { queryParams: { ids: ids} } );
This uses query params. The url will be like this /componentb?ids=['a','b','c','d']
/componentb?ids=['a','b','c','d']
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You are confusing route params with query params.
/componentb/:ids
will only match on/componentb/1
etc but not/componentb
.In this scenario
:ids
is a ROUTE param, you need a query param.You will need to change the route to
and then navigate as follows
This uses query params. The url will be like this
/componentb?ids=['a','b','c','d']