You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-33Lines changed: 11 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -75,12 +75,18 @@ The value is relative to the visible height of the area, the default is 0.5 and
75
75
***start-index - value**, optional - index of the first item to be requested from the datasource. The default is 1.
76
76
***adapter - name**, optional - if provided a reference to the adapter object for the scroller instance will be placed in the member with the said name on the scope associated with the viewport. If the viewport is the window, the value will be placed on the $rootScope. If you have multiple scrollers within the same viewport, make sure that every one of them has its unique adapter name.
77
77
78
+
***adapter - expression**, optional - if provided a reference to the adapter object for the scroller instance will be injected in the appropriate scope. If you have multiple scrollers within the same viewport, make sure that every one of them has its unique adapter name.
79
+
78
80
Some of the properties offered by the adapter can also be accessed directly from the directive by using matching attributes. In the same way as for the adapter attribute, syntax for such attributes allows for providing a name to be used to access the corresponding value. A reference to the value will be placed on the scope associated with the viewport. If the viewport is the window, the value will be placed on the $rootScope. Below is a list of such attributes:
79
81
80
-
***is-loading - name**, optional - a boolean value indicating whether there are any pending load requests will be placed in the member with the said name. See also `isLoading` adapter property.
81
-
***top-visible - name**, optional - a reference to the item currently in the topmost visible position will be placed in the member with the said name. See also `topVisible` adapter property.
82
-
***top-visible-element - name**, optional - a reference to the DOM element currently in the topmost visible position will be placed in the member with the said name. See also `topVisibleElement` adapter property.
83
-
***top-visible-scope - name**, optional - a reference to the scope created for the item currently in the topmost visible position will be placed in the member with the said name. See also `topVisibleScope` adapter property.
82
+
***is-loading - expression**, optional - a boolean value indicating whether there are any pending load requests will be injected in the appropriate scope. See also `isLoading` adapter property.
83
+
***top-visible - expression**, optional - a reference to the item currently in the topmost visible position will be injected in the appropriate scope. See also `topVisible` adapter property.
84
+
***top-visible-element - expression**, optional - a reference to the DOM element currently in the topmost visible position will be injected in the appropriate scope. See also `topVisibleElement` adapter property.
85
+
***top-visible-scope - expression**, optional - a reference to the scope created for the item currently in the topmost visible position will be injected in the appropriate scope. See also `topVisibleScope` adapter property.
86
+
87
+
The `expression` can be any angular assignable expression. The scroller will inject the requested value into the target scope by applying the target expression. The scope associated with the viewport (the element marked with the [uiScrollViewport](#uiscrollviewport-directive) directive) will be used as the target scope. If the viewport is not defined (window viewport), the $rootScope will be used as the target scope.
88
+
89
+
The second format `expression on controller` can be used to explicitly specify the scope associated with the specified controller as the target scope for the injection. In this format `expression` is any angular assignable expression, and `controller` is the name of controller constructor function as specified in the `ng-controller` directive. The scroller will traverse its parents to locate the target scope associated with the specified controller.
84
90
85
91
###Data Source
86
92
Data source is an object to be used by the uiScroll directive to access the data.
@@ -183,7 +189,7 @@ In the fashion similar to ngRepeat the following animations are supported:
183
189
* .enter - when a new item is added to the list
184
190
* .leave - when an item is removed from the list
185
191
186
-
Animations are only supported for the updates made via applyUpdates method. Updates caused by scrolling are not going through animation transitions. Usual [rules](https://docs.angularjs.org/api/ngAnimate) of working with Angular animations apply. Look [here](http://rawgit.com/angular-ui/ui-scroll/master/demo/examples/animation.html) for an example of animations in the scroller
192
+
Animations are only supported for the updates made via applyUpdates method. Updates caused by scrolling are not going through animation transitions. Usual [rules](https://docs.angularjs.org/api/ngAnimate) of working with Angular animations apply. Look [here](http://rawgit.com/angular-ui/ui-scroll/master/demo/animation/animation.html) for an example of animations in the scroller
187
193
188
194
uiScrollViewport directive
189
195
-------------------
@@ -314,31 +320,3 @@ To run the examples use this [link](http://rawgithub.com/angular-ui/ui-scroll/ma
314
320
* Deep 'name' properties access via dot-notation in template.
315
321
* Fixed the problem occurring if the scroller is $destroyed while there are requests pending: [#64](https://github.com/Hill30/NGScroller/issues/64).
316
322
317
-
####v1.0.3
318
-
* Fixed memory leak on scroller destroy: [#63](https://github.com/Hill30/NGScroller/issues/63).
319
-
* Removed examples from bower download list.
320
-
321
-
####v1.0.2
322
-
* Registration of ui-scroll in bower.
323
-
324
-
####v1.0.1
325
-
* Deep datasource access via dot-notation in template.
326
-
*[Angular 1.3.x breaking change](https://github.com/angular/angular.js/issues/8876) fix with backward compatibility.
327
-
328
-
####v1.0.0
329
-
330
-
* Renamed ng-scroll to ui-scroll.
331
-
* Reduced server requests by eof and bof recalculation.
332
-
* Support for inline-block/floated elements.
333
-
* Reduced flickering via new blocks rendering optimization.
334
-
* Prevented unwanted scroll bubbling.
335
-
* Fixed race-condition and others minor bugs.
336
-
* Added more usage examples (such as cache within datasource implementation).
337
-
338
-
####v0.1.*
339
-
340
-
Introduced `is-loading` and `top-visible-*` attributes. Streamlined and added a few more usage examples.
341
-
342
-
####v0.0.*
343
-
344
-
Initial commit including uiScroll, uiScrollViewPort directives and usage examples.
0 commit comments