Skip to content

Commit 29e1a15

Browse files
committed
Merge pull request #94 from angular-ui/grid
Attribute injection docs
2 parents ca71ac3 + 27b8447 commit 29e1a15

File tree

1 file changed

+11
-33
lines changed

1 file changed

+11
-33
lines changed

README.md

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,18 @@ The value is relative to the visible height of the area, the default is 0.5 and
7575
* **start-index - value**, optional - index of the first item to be requested from the datasource. The default is 1.
7676
* **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.
7777

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+
7880
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:
7981

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.
8490

8591
###Data Source
8692
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:
183189
* .enter - when a new item is added to the list
184190
* .leave - when an item is removed from the list
185191

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
187193

188194
uiScrollViewport directive
189195
-------------------
@@ -314,31 +320,3 @@ To run the examples use this [link](http://rawgithub.com/angular-ui/ui-scroll/ma
314320
* Deep 'name' properties access via dot-notation in template.
315321
* Fixed the problem occurring if the scroller is $destroyed while there are requests pending: [#64](https://github.com/Hill30/NGScroller/issues/64).
316322

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

Comments
 (0)