twp0217/ngx-timeline

How get an event index or the event itself?

Closed this issue · 3 comments

I customized the timelineFooter with a button, to trigger an event, but i cannot get index or event information. I thought I could get it from "let-event" or "let-index" directives, but i am not sure of that.

you can use let-rowIndex get index

I do not know what I might be doing wrong.

<ngx-timeline [events]="events"> <ng-template margin-bottom timelineFooter let-event="event" let-index="rowIndex" > <button ion-button block icon-left small color="secondary" (click)="openDetail(event)" > <ion-icon name="add"></ion-icon> Detalhes </button> </ng-template> </ngx-timeline>

in messages.ts:

events: Array<TimelineEvent>; event: TimelineEvent; rowIndex = "";

In the "openDetail" function, I just try to print the values ​​of rowIndex and event, but both appear undefined

Problem solved! Only then did I notice that you had let-rowIndex used and it is let-index in the documentation.