You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e107dfc
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -139,7 +147,7 @@ export default class ProductPage {
139
147
}
140
148
```
141
149
142
-
Use `satisfies RouteMeta` instead of a `RouteMeta` annotation. An annotation widens the object, so data values are typed as `unknown`.
150
+
Use `satisfies RouteMeta`(or `satisfies RouteMeta<'/products/[id]'>` to also type `route.params`, `route.queryParams`, and inherited layout `route.data` inside resolvers) instead of a `RouteMeta` annotation. An annotation widens the object, so data values are typed as `unknown`.
143
151
144
152
`injectLoad` also accepts a route path. The result is typed from the page's `.server.ts``load` function, so the page does not need to import it:
145
153
@@ -153,17 +161,33 @@ As with Angular's route data inheritance, a page's keys override the same keys f
153
161
154
162
## Access route resources
155
163
156
-
On Angular 22.2+, when using `withRouterResources()`, `injectResources` returns the reactive resources defined on the route via `routeMeta.resources`:
164
+
On Angular 22.2+, when using `withRouterResources()`, `injectResources` returns the reactive resources defined on the route via `routeMeta.resources` (and on Angular 22.3+, resources inherited from ancestor [layout routes](/docs/features/routing/overview#layout-routes) as well). As with route data, a child route's resource keys override matching keys from its layouts.
165
+
166
+
Pass the route path to `RouteMeta` to type `ctx.params`, `ctx.queryParams`, `ctx.data`, and inherited ancestor `ctx.resources` inside `routeMeta.resources`:
// resources.product and inherited resources.catalog are typed Resource instances
187
+
constproduct=resources.product.value();
164
188
```
165
189
166
-
Calling `injectResources()` without a route path returns untyped route resources. On older Angular versions without router resources, it returns an empty object. The other typed-routing helpers do not require router resources.
190
+
Calling `injectResources()` without a route path returns untyped route resources. On older Angular versions without router resources, it returns an empty object. Shared URLs have no typed resource keys, matching `injectRouteData`. The other typed-routing helpers do not require router resources.
0 commit comments