Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Angularroutingwithqueryparams

I've got an Angular app where I have several server-paginated lists and cards for these lists' items. (we could think of it like an Angular tutorial heroes app where there is a list of heroes and a card for hero details, but in my case I've got a pagination).

I've heard of @ngrx/route-store and not sure whether it's worth to spend my time learning it for my purposes.

The question is how it is better to deal with query params which store current page on list when you go to card and then you need to be redirected to where you've been.

Update

Small illustration

On the left side there is a list and pagination. Imagine that you've chosen a 2nd item on a 2n page (highlighted). You click on this item and go to this item's card (right side of the page), then you've changed this item, saved and should be redirected to the previous page (left side of the page). If you do it in a standard way you would be on 1st page since the page you were on is saved nowhere. Usually page number is stored in query params so url looks like my-awesome-site.com/heroes?page=2.

So I need somehow to keep this page number but only for card (I've got multiple lists with paginations and I don't need to go to other list with page number of previous list's page. So I ask of better way of implementing this(keeping page number somewhere).

Comments