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

Skip to content

docs(template): fix virtual scroll strategy usage description #1549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions apps/docs/docs/template/api/virtual-scrolling.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export class MyComponent {}
```

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

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

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

```html
<rx-virtual-scroll-viewport>
<div
class="hero"
[itemSize]="50"
*rxVirtualFor="let hero of heroes; trackBy: 'id'"
>
<rx-virtual-scroll-viewport [itemSize]="50">
<div class="hero" *rxVirtualFor="let hero of heroes; trackBy: 'id'">
<div>
<div><strong>{{ hero.name }}</strong></div>
<div>{{ hero.id }}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface RxVirtualListTemplateManager<T, C> {
* @internal
*
* Factory that returns a `ListTemplateManager` for the passed params.
* Similar to https://github.com/angular/components/blob/main/src/cdk/collections/recycle-view-repeater-strategy.ts
*
* @param templateSettings
*/
Expand Down