使用 NativeScript 3 + Angular 5。
我需要允许用户在 RadListView 中滑动项目以显示有关该项目的简短描述。
<RadListView
[items]="featuredVideos"
pullToRefresh="true"
selectionBehavior="None"
(itemSwipeProgressStarted)="onSwipeCellStarted($event)"
swipeActions="true"
(pullToRefreshInitiated)="onPullToRefreshInitiated($event)">
<ng-template tkListItemTemplate let-item="item">
<VideoComponent [video]="item"></VideoComponent>
</ng-template>
<ng-template tkListItemSwipeTemplate let-item="item">
<GridLayout columns="*, 500" class="gridLayoutLayout">
<StackLayout id="short-desc" col="1">
<Label [text]="item.shortDescription" class="body" verticalAlignment="center" horizontalAlignment="center"></Label>
</StackLayout>
</GridLayout>
</ng-template>
</RadListView
我希望能够访问tkListItemSwipeTemplate中的当前项目,以便我可以将标签的文本属性绑定到简短描述。目前我收到以下错误
JS: ERROR TypeError: Cannot read property 'shortDescription' of undefined