# Get parameter from parent route (router-lite)

**URL:** <https://discourse.aurelia.io/t/get-parameter-from-parent-route-router-lite/5187>\
**Category:** vNext\
**Created:** [June 22, 2023, 9:33am UTC](https://discourse.aurelia.io/t/get-parameter-from-parent-route-router-lite/5187 "2023-06-22T09:33:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elitastic](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/elitastic/32/1787_2.png) [@elitastic](https://discourse.aurelia.io/u/elitastic)\
**Post date:** [June 22, 2023, 9:33am UTC](https://discourse.aurelia.io/t/get-parameter-from-parent-route-router-lite/5187/1 "2023-06-22T09:33:55Z")

</div>

Is it possible to get route parameters from parent in a child route (router-lite)?

> **[parameters from parent - StackBlitz](https://stackblitz.com/edit/au2-conventions-nb85wr)**
>
> Run Aurelia application with conventions

Thanks for any help!

---

<div class="post-metadata">

**Author:** ![Sayan751](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/sayan751/32/1861_2.png) [@Sayan751](https://discourse.aurelia.io/u/Sayan751)\
**Post date:** [July 1, 2023, 8:29am UTC](https://discourse.aurelia.io/t/get-parameter-from-parent-route-router-lite/5187/2 "2023-07-01T08:29:55Z")

</div>

Hi @elitastic! In your example, you are already passing the `id` as a route parameter to the `employee-info`, and as I see here, those parameters are read correctly as well. You can see that here: [parameters from parent (forked) - StackBlitz](https://stackblitz.com/edit/au2-conventions-8fqcru?file=src%2Femployee-info.ts,src%2Femployee-info.html,src%2Femployee.html).

However, I feel that you are looking for a way to avoid having the `:id`route parameter for the `info` route, because it produces `/employee/1/info/1`, which might be aesthetically displeasing. If that’s what bothering you, then you might choose to inject the `IRouteContext` and grab the parameter from the parent node. A [hasty example](https://stackblitz.com/edit/au2-conventions-qs3u1f?file=src%2Femployee.ts,src%2Femployee-info.html,src%2Femployee-info.ts,src%2Femployee.html) looks like below.

```ts
import { resolve } from '@aurelia/kernel';
import { IRouteContext } from '@aurelia/router-lite';

export class EmployeeInfo {
  private readonly id: string = resolve(IRouteContext).parent.node.params.id;
}

```

---

<div class="post-metadata">

**Author:** ![elitastic](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/elitastic/32/1787_2.png) [@elitastic](https://discourse.aurelia.io/u/elitastic)\
**Post date:** [July 3, 2023, 7:15am UTC](https://discourse.aurelia.io/t/get-parameter-from-parent-route-router-lite/5187/3 "2023-07-03T07:15:25Z")

</div>

Perfect, thanks for your help!
