Tim Deschryver 2/22/2022

TIL params inheritance strategy to always have access to parent route info

Read Original

This Angular development article details a common problem of accessing parent route parameters (e.g., companyId) from deeply nested child components. It critiques the brittle practice of chaining `.parent` references and introduces the built-in `paramsInheritanceStrategy` router option. Setting this option to 'always' automatically merges all ancestor parameters into the activated route's snapshot, simplifying code and improving maintainability.

TIL params inheritance strategy to always have access to parent route info

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week