DEV Community

Cover image for How to Access Angular Parent Route Params
es404020
es404020

Posted on

How to Access Angular Parent Route Params

*Case Study *

Assume your app-routing.module.ts looks like this

Image description

*Problem Statement *

How do we access the accountNumber params from the children route.

*Possible Solution

Image description

This Works but it not the best solutions.

Best Solution

Update your app-routing.module.ts

Image description

paramsInheritanceStrategy: 'always' ==> This gives your access to parent params.Which make it easier to access parent params by doing

Image description

Thanks for reading you can support by Support link

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

Deploy and scale your apps on AWS and GCP with a world class developer experience

Coherence makes it easy to set up and maintain cloud infrastructure. Harness the extensibility, compliance and cost efficiency of the cloud.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay