Excess Looping in ListView with nsTemplateKey?


#1

I’m using nsTemplateKey on ng-templates inside of a list view. I dump the indices:

public templateSelector(item: SimpleDataMapping, index: number, items: any): string {
    console.log('template selected: ' + index);
    return item.type;
}

and get this odd result:

JS: template selected: 0
JS: template selected: 0
JS: template selected: 0
JS: template selected: 0
JS: template selected: 1
JS: template selected: 1
JS: template selected: 1
JS: template selected: 1
JS: template selected: 2
JS: template selected: 2
JS: template selected: 2
JS: template selected: 2
JS: template selected: 3
JS: template selected: 3
JS: template selected: 3
JS: template selected: 3
JS: template selected: 4
JS: template selected: 4
JS: template selected: 4
JS: template selected: 4

Am I doing this wrong or is it normal to reprocess the same index without any scrolling yet?