📜  角材料-虚拟重复

📅  最后修改于: 2020-10-28 05:02:19             🧑  作者: Mango


md-virtual-repeat-container是md-virtual-repeat组件的滚动容器。

属性

下表列出了md-virtual-repeat-container的不同属性的参数和说明。

Sr.No Parameter & Description
1

md-top-index

Binds the index of the item that is at the top of the scroll container to $scope. It can both read and set the scroll position.

2

md-orient-horizontal

Determines whether the container should scroll horizontally (defaults to orientation and scrolling vertically).

3

md-auto-shrink

When present, the container will shrink to fit the number of items when that number is less than its original size.

4

md-auto-shrink-min

Minimum number of items that md-auto-shrink will shrink to (default: 0).

md-virtual-repeat

虚拟重复是ng-repeat的替代,它仅呈现足够的html元素来填充容器并在用户滚动时重复使用它们。

属性

下表列出了md-virtual-repeat的不同属性的参数和说明。

Sr.No Parameter & Description
1

md-item-size

The height or width of the repeated elements (which must be identical for each element). This is optional. This attempts to read the size from the dom if missing, but still assumes that all repeated nodes have same height or width.

2

md-extra-name

Evaluates to an additional name to which the current iterated item can be assigned on the repeated scope (needed for use in md-autocomplete).

3

md-on-demand

When present, treats the md-virtual-repeat argument as an object that can fetch rows rather than an array.This object must implement the following interface with two (2) methods −

  • getItemAtIndex − function(index) [object] – The item at that index or null if it is not yet loaded (it should start downloading the item in that case).

  • getLength − function() [number] – The data length to which the repeater container should be sized. Ideally, when the count is known, this method should return it. Otherwise, return a higher number than the currently loaded items to produce an infinite-scroll behavior.

以下示例显示了虚拟重复的用法。

am_virtualrepeat.htm


      
      
      
      
      
      
      
      
      
            
   
   
    
      

Horizontal Repeat

{{item}}

Vertical Repeat

{{item}}

结果

验证结果。