@@ -61,8 +61,8 @@ memory you may wish to reduce this number to avoid spending too much memory on t
61
61
</cdk-virtual-scroll-viewport >
62
62
```
63
63
64
- #### Specifying items with an Observable or DataSource
65
- ` *cdkVirtualFor ` is set up to accept data from an ` Array ` , ` Observable ` , or ` DataSource ` . The
64
+ #### Specifying data
65
+ ` *cdkVirtualFor ` accepts data from an ` Array ` , ` Observable<Array> ` , or ` DataSource ` . The
66
66
` DataSource ` for the virtual scroll is the same one used by the table and tree components. A
67
67
` DataSource ` is simply an abstract class that has two methods: ` connect ` and ` disconnect ` . The
68
68
` connect ` method will be called by the virtual scroll viewport to receive a stream that emits the
@@ -71,11 +71,11 @@ destroyed, which may be the right time to clean up any subscriptions that were r
71
71
connect process.
72
72
73
73
### Scrolling over fixed size items
74
- If you're scrolling over a list of items that are all the same fixed size, you can use the
75
- ` FixedSizeVirtualScrollStrategy ` . This can be easily added to your viewport using the ` itemSize `
76
- directive. The fixed size viewport strategy is less flexible than the autosize strategy because it
77
- requires all items to be the same size, but the advantage of this constraint is that it allows for
78
- better performance, since items do not need to be measured as they are rendered.
74
+ When all items are the same fixed size,, you can use the ` FixedSizeVirtualScrollStrategy ` . This can
75
+ be easily added to your viewport using the ` itemSize ` directive. The fixed size viewport strategy is
76
+ less flexible than the autosize strategy because it requires all items to be the same size, but the
77
+ advantage of this constraint is that it allows for better performance, since items do not need to be
78
+ measured as they are rendered.
79
79
80
80
``` html
81
81
<cdk-virtual-scroll-viewport itemSize =" 50" >
@@ -96,9 +96,8 @@ beyond the edge of the viewport. This can be adjusted by setting the `bufferSize
96
96
` minBufferPx ` and ` addBufferPx ` like the autosize strategy**
97
97
98
98
### Scrolling over items with different sizes
99
- If you're scrolling over a list of items with different sizes, you can use the
100
- ` AutoSizeVirtualScrollStrategy ` . This can be added to your viewport by using the ` autosize `
101
- directive.
99
+ When the items have different or unknown sizes, you can use the ` AutoSizeVirtualScrollStrategy ` .
100
+ This can be added to your viewport by using the ` autosize ` directive.
102
101
103
102
``` html
104
103
<cdk-virtual-scroll-viewport autosize >
0 commit comments