Skip to content

Commit bf832e4

Browse files
committed
Merge remote-tracking branch 'upstream/virtual-scroll' into vs2
2 parents 644428f + 0e4a580 commit bf832e4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/demo-app/virtual-scroll/virtual-scroll-demo.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,11 @@ export class VirtualScrollDemo {
106106
return 0;
107107
}));
108108
}
109+
110+
sortBy(prop: 'name' | 'capital') {
111+
this.statesObservable.next(this.states.map(s => ({...s})).sort((a, b) => {
112+
const aProp = a[prop], bProp = b[prop];
113+
return aProp < bProp ? -1 : (aProp > bProp ? 1 : 0);
114+
}));
115+
}
109116
}

0 commit comments

Comments
 (0)