Skip to content

Commit 2dbafee

Browse files
committed
address comments
1 parent 22bacb1 commit 2dbafee

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/cdk-experimental/scrolling/virtual-for-of.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,15 @@ export class CdkVirtualForOf<T> implements CollectionViewer, DoCheck, OnDestroy
271271
});
272272

273273
// Update $implicit for any items that had an identity change.
274-
changes.forEachIdentityChange((record: any) => {
275-
const view = this._viewContainerRef.get(record.currentIndex) as
274+
changes.forEachIdentityChange((record: IterableChangeRecord<T>) => {
275+
const view = this._viewContainerRef.get(record.currentIndex!) as
276276
EmbeddedViewRef<CdkVirtualForOfContext<T>>;
277277
view.context.$implicit = record.item;
278278
});
279279

280280
// Update the context variables on all items.
281-
let i = this._viewContainerRef.length, count = this._data.length;
281+
const count = this._data.length;
282+
let i = this._viewContainerRef.length;
282283
while (i--) {
283284
const view = this._viewContainerRef.get(i) as EmbeddedViewRef<CdkVirtualForOfContext<T>>;
284285
view.context.index = this._renderedRange.start + i;

0 commit comments

Comments
 (0)