From 605775398f0ae1893a0a02a6eb3c1200f20475e9 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Mon, 4 Jan 2021 10:32:28 -0800 Subject: [PATCH] docs(router): Clarify 'parent' for params inheritance (#40304) When talking about parameter inheritance, one might think that matrix parameters can be inherited from the "parent" segment, or the segment which appears immediately to the left. In reality, when we talk about a "parent" in the `Router`, we mean the parent `Route` config. This config may contain more than one segment and matrix parameters must appear at the end or they do not "belong" to any config. PR Close #40304 --- packages/router/src/router_module.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/router/src/router_module.ts b/packages/router/src/router_module.ts index cd4372f97f..81bc596475 100644 --- a/packages/router/src/router_module.ts +++ b/packages/router/src/router_module.ts @@ -360,7 +360,15 @@ export interface ExtraOptions { * Defines how the router merges parameters, data, and resolved data from parent to child * routes. By default ('emptyOnly'), inherits parent parameters only for * path-less or component-less routes. + * * Set to 'always' to enable unconditional inheritance of parent parameters. + * + * Note that when dealing with matrix parameters, "parent" refers to the parent `Route` + * config which does not necessarily mean the "URL segment to the left". When the `Route` `path` + * contains multiple segments, the matrix parameters must appear on the last segment. For example, + * matrix parameters for `{path: 'a/b', component: MyComp}` should appear as `a/b;foo=bar` and not + * `a;foo=bar/b`. + * */ paramsInheritanceStrategy?: 'emptyOnly'|'always';