Pass parameter by (Click) on card

Hello everybody,

I feel dummy, but I can not pass a parameter when clicking on a card.
Here is my html file where I want pass the id of my item to the function navigate :

<ion-content class="cards-bg">
    <ion-item *ngFor="let item of (items |async)?.slice().reverse()" text-wrap>
      <ion-card tappable (click)="navigate(" class="cards-bg">
        <img src="assets/imgs/chpt2017.jpeg"/>

Here my .ts file :

navigate(id: string){
    console.log('id : ' || id);

And in the log, id is blank …

I searched before to ask my question, but I do not understand what I’m doing wrong.

Thanks a lot.

Use console.log('id : ’ , id)

And down the road u may need to


So u can adress the data using navparams.get(‘id’)

Thanks a lot Tommertom !!!

1 Like