5

I'm trying to pass query params (not route params) to each one of my auxiliary routes.

What I'm trying to achieve is to have 3 sibling components, each one subscribed and consuming query params from it's own auxiliary route, and populating my page with 3 different data sources, making pagination/query possible and independent for each one.

My urls should look like this, following Angular's Auxiliary Routes pattern:

http://mywebsite.com/search(musics:/?page=1&itemsPerPage=12&orderBy=createdAt/movies:/?page=1&itemsPerPage=12&orderBy=createdAt/tvShows:/?page=1&itemsPerPage=12&orderBy=createdAt)

And then in each one of my components I can subscribe to it's specific auxiliary route change and trigger the request to my API when I navigate.

I know this is possible whith route params, but I want to have flexibility to input only required query params. Is this possible to achieve in Angular?

Thanks!

thorn0
  • 9,362
  • 3
  • 68
  • 96
Felipe Micali
  • 827
  • 1
  • 11
  • 25

0 Answers0