ngxtension / ngxtension-platform

Utilities for Angular
https://ngxtension.netlify.app/
MIT License
592 stars 87 forks source link

injectParams - option for injecting child route params in parent compnent #381

Open DerHerrGammler opened 4 months ago

DerHerrGammler commented 4 months ago

It would be great if there would be a simple injection method for getting all route params. So also the params from child routes.

As example I got the following routes:
/example/:id and /example/:id/:otherParam

The second path is a child route of the first and I want to access the :otherParam from the parent route. A option for that within the injectParams() or a new injectChildParams() would be great.

bastienmoulia commented 2 months ago

I use this, but it may be improved: https://gist.github.com/bastienmoulia/f79ead995a27bd98b4cea1c8425e1112