Virtual Scroll - binding a function



I m binding a function to virtual scroll "item.dateAgo() ":

<ion-list [virtualScroll]="items" approxItemHeight="200px"
          approxHeaderHeight="0px" approxFooterHeight="0px">
    <ion-card *virtualItem="let item" (click)="itemTapped($event, item)">
        <div class="card-subtitle" [innerHTML]="item.dateAgo() + ' / ' + item.sourceTitle"></div>

And I have the following error:

TypeError: self.context.$implicit.dateAgo is not a function

For the first iterations , the function is called without error.

Someone a hint?


i was using moment.js in the function item.dateAgo().

Using a pipe with moment.js correct the problem.