---
description: When list item information should be on different page
---

# Passing list item index via router

There can be situation when list item is on page and its details on another. So question is how to deal with `stateIndex`. For this case you can pass list item index along with url params

```markup
<a href="#" [routerLink]="['/dictionaries', i]" class="card-link">Go To Values</a>
```

and on target component catch it and assign to `stateIndex`

```typescript
constructor(private route: ActivatedRoute, private router: Router) {
    super();
    this.route.params.subscribe((params: Params) => {
      this.stateIndex = params.id;
    });
  }
```

and it will be passed to actions automatically.

**Or with signal actions:**

```typescript
constructor(private route: ActivatedRoute, private router: Router) {
}
  

ngOnInit(): void {
    this.route.params.subscribe((params: Params) => {
      this.actions = signalActions(TodoStateActions, { 
        statePath: this.statePath, 
        stateIndex: params.id 
      });
    });
}

```
