1

I'm using Angular 5 and I have this ngFor:

<div class="row margin-v-20">
    <my-tile [routerLink]="['/secondPage', item.id, 'item-list']" *ngFor="let item of listaOfItem" [item]="item"></my-tile>
</div>

and I need to access from the routed component "secondPage/:id/item-list" to the json object "item" of the list.

How can I achieve this?

Stack Diego
  • 1,309
  • 17
  • 43

1 Answers1

1

This article explains several ways to achieve this. I recommend to use a service to share the complex data between components ("Using Application Providers" section in the article).

Bünyamin Sarıgül
  • 3,031
  • 4
  • 30
  • 55