1+ <!doctype html>
2+ < html >
3+
4+ < head >
5+ < meta charset ="utf-8 ">
6+ < title > Buffer first, last, length</ title >
7+ < script src ="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.1/angular.js "> </ script >
8+ < script src ="../../dist/ui-scroll.js "> </ script >
9+ < script src ="bufferItems.js "> </ script >
10+ < link rel ="stylesheet " href ="../css/style.css " type ="text/css " />
11+ </ head >
12+
13+ < body ng-app ="application " ng-controller ="mainController ">
14+
15+ < div class ="cont cont-global ">
16+
17+ < a class ="back " href ="../index.html "> browse other examples</ a >
18+
19+ < h1 class ="page-header page-header-exapmle "> Buffer first, last, length</ h1 >
20+
21+ < div class ="description ">
22+ The ui-scroll Adapter has 3 read-only properties which provide information of current ui-scroll Buffer state.
23+ The buffer contains some visible items and some items that are out of visible part of the viewport.
24+ So with these properties we can get the topmost and the bottommost items that the ui-scroll is dealing with at the moment.
25+ At the template's layer it may look like
26+
27+ < div class ="code ">
28+ < pre > {{adapter.bufferFirst}<!----> }
29+ {{adapter.bufferLast}<!----> }
30+ {{adapter.bufferLength}<!----> }
31+
32+ <li ui-scroll="item in datasource" adapter="adapter">{{item}<!----> }</li></ pre >
33+ </ div >
34+ </ div >
35+
36+ < div class ="info ">
37+ < div class ="info-item "> < span class ="info-item-label "> First buffer</ span > {{adapter.bufferFirst}}</ div >
38+ < div class ="info-item "> < span class ="info-item-label "> Last buffer</ span > {{adapter.bufferLast}}</ div >
39+ < div class ="info-item "> < span class ="info-item-label "> Buffer length:</ span > {{adapter.bufferLength}}</ div >
40+ </ div >
41+
42+ < div class ="viewport " id ="viewport-listScroller " ui-scroll-viewport >
43+ < ul >
44+ < li ui-scroll ="item in datasource " adapter ="adapter "> {{item}}</ li >
45+ </ ul >
46+ </ div >
47+
48+ </ div >
49+
50+ </ body >
51+
52+ </ html >
0 commit comments