Nativescript radListView无法按id获取项

Nativescript radListView无法按id获取项,nativescript,angular2-nativescript,Nativescript,Angular2 Nativescript,嗨,我正在使用{N}和angular2 从RadListView中通过Id访问视图时出现以下错误 <RadListView id="listView" [items]="posts" loadOnDemandMode="Manual" scrollDirection="Vertical" itemInsertAnimation="Fade" itemDeleteAnimation="Fade" (loadMoreDataRequested

嗨,我正在使用{N}和angular2 从RadListView中通过Id访问视图时出现以下错误

<RadListView id="listView" [items]="posts" loadOnDemandMode="Manual" scrollDirection="Vertical"
             itemInsertAnimation="Fade" itemDeleteAnimation="Fade"
             (loadMoreDataRequested)="onLoadMoreItemsRequested($event)">
    <template tkListItemTemplate let-post="item">
        <CardView id="post-{{ post.kl_id }}" margin="8 0 8 0" elevation="15" class="whiteCard" shadowOffsetHeight="3" shadowOffsetWidth="1">
            <Label (tap)="doSomethingWithPost(post)"></Label>
        </CardView>
    </template>
</RadListView>
我正在犯错误

TypeError: undefined is not an object (evaluating 'value.view.itemView')
使用viewChild

@ViewChild(/* id like*/ 'foo') myElement: ElementRef;

 ngAfterViewInit() {
    let myfoo= this.myElement
}

Hi Habib id是动态的,它在循环中,这里我的目标是在点击特定项目并通过id获取该项目时从视图中删除该项目(CardView)。。上面的代码可以很好地用于ListView,而不适用于“RadListView”,因此请尝试使用此代码添加一个变量,并像doSomethingWithPost(post,myVar)一样传递它
@ViewChild(/* id like*/ 'foo') myElement: ElementRef;

 ngAfterViewInit() {
    let myfoo= this.myElement
}