Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0a599db

Browse files
authored
Merge pull request #1549 from rx-angular/fix-virtual-scroll-docs
docs(template): fix virtual scroll strategy usage description
2 parents a8a0537 + 758ad1c commit 0a599db

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

apps/docs/docs/template/api/virtual-scrolling.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ export class MyComponent {}
5151
```
5252

5353
```html
54-
<rx-virtual-scroll-viewport>
55-
<div [itemSize]="50" *rxVirtualFor="let hero of heroes$;">
54+
<rx-virtual-scroll-viewport [itemSize]="50">
55+
<div *rxVirtualFor="let hero of heroes$;">
5656
<div>
5757
<div><strong>{{ hero.name }}</strong></div>
5858
<div>{{ hero.id }}</div>
@@ -150,8 +150,8 @@ export class MyComponent {}
150150
### Fixed size virtual-scroll using `*rxVirtualFor` with `Observable` values
151151

152152
```html
153-
<rx-virtual-scroll-viewport>
154-
<div class="hero" [itemSize]="50" *rxVirtualFor="let hero of heroes$;">
153+
<rx-virtual-scroll-viewport [itemSize]="50">
154+
<div class="hero" *rxVirtualFor="let hero of heroes$;">
155155
<div>
156156
<div><strong>{{ hero.name }}</strong></div>
157157
<div>{{ hero.id }}</div>
@@ -179,8 +179,8 @@ export class AnyComponent {
179179
### Fixed size virtual-scroll using `*rxVirtualFor` with static values
180180

181181
```html
182-
<rx-virtual-scroll-viewport>
183-
<div class="hero" [itemSize]="50" *rxVirtualFor="let hero of heroes">
182+
<rx-virtual-scroll-viewport [itemSize]="50">
183+
<div class="hero" *rxVirtualFor="let hero of heroes">
184184
<div>
185185
<div><strong>{{ hero.name }}</strong></div>
186186
<div>{{ hero.id }}</div>
@@ -210,12 +210,8 @@ export class AnyComponent {
210210
The `trackBy` input either takes a `keyof T` or the regular `TrackByFunction` (`(index: number, item: T) => any`) as a value.
211211

212212
```html
213-
<rx-virtual-scroll-viewport>
214-
<div
215-
class="hero"
216-
[itemSize]="50"
217-
*rxVirtualFor="let hero of heroes; trackBy: 'id'"
218-
>
213+
<rx-virtual-scroll-viewport [itemSize]="50">
214+
<div class="hero" *rxVirtualFor="let hero of heroes; trackBy: 'id'">
219215
<div>
220216
<div><strong>{{ hero.name }}</strong></div>
221217
<div>{{ hero.id }}</div>

libs/template/experimental/virtual-scrolling/src/lib/virtual-list-template-manager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export interface RxVirtualListTemplateManager<T, C> {
3333
* @internal
3434
*
3535
* Factory that returns a `ListTemplateManager` for the passed params.
36+
* Similar to https://github.com/angular/components/blob/main/src/cdk/collections/recycle-view-repeater-strategy.ts
3637
*
3738
* @param templateSettings
3839
*/

0 commit comments

Comments
 (0)