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
+18-8Lines changed: 18 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -177,14 +177,22 @@ Some of the properties offered by the adapter can also be accessed directly from
177
177
178
178
The `expression` can be any angular expression (assignable expression where so specified). All expressions are evaluated once at the time when the scroller is initialized. Changes in the expression value after scroller initialization will have no impact on the scroller behavior.
179
179
180
-
The `assignable expressions` will be used by scroller to inject the requested value into the target scope.
181
-
The target scope is being defined in accordance with standard Angular rules (nested scopes and controller As syntax should be taken into account):
182
-
the scroller will traverse its parents (from the ui-scroll element's scope up to the $rootScope) to locate the target scope.
183
-
If the viewport is presented (the element marked with the [uiScrollViewport](#uiscrollviewport-directive) directive),
184
-
then the scope associated with the viewport will be a start point in the target scope locating.
185
-
Angular $parse service is being used in `assignable expressions` implementation.
180
+
#### Assignable expressions
186
181
187
-
_Deprecated!_ The format `expression on controller` introduced in v1.5.0 (and deprecated in v1.6.1) can be used to explicitly target 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.
182
+
The `assignable expressions` will be used by scroller to inject the requested value into the target scope. The target scope locating is based on AngularJS $parse service. If the viewport is presented (the element marked with the uiScrollViewport directive), then the scope associated with the viewport will be a start point in the target scope locating. If not, the scope next to ui-scroll local scopes (ui-scroll parent scope) will be a start point.
183
+
184
+
Please notice that property defined via `assignable expression` could be unavailable in case of nested scopes and non-explicit assignment. For example, if you want to have the Adapter on some controller's scope and there are intermediate scopes in between (obtained by ng-if or whatever), you should use Controller As syntax or explicitly define at least two-level object hierarchy on your controller:
185
+
186
+
```
187
+
<div ng-controller="MyController">
188
+
<div ng-if="show">
189
+
<div ui-scroll="item in datasource" adapter="container.adapter">
190
+
```
191
+
192
+
```
193
+
.controller('MyController', function($scope) {
194
+
$scope.contaner = { adapter: {} };
195
+
```
188
196
189
197
### Datasource
190
198
@@ -227,6 +235,8 @@ exactly `count` elements unless it hit eof/bof.
227
235
228
236
The adapter object is an internal object created for every instance of the scroller. Properties and methods of the adapter can be used to manipulate and assess the scroller the adapter was created for.
229
237
238
+
The adapter object is determined via ui-scroll attribute "adapter", which value is construed as [assignable expression](#assignable-expressions).
239
+
230
240
Adapter object implements the following properties:
231
241
232
242
*`isLoading` - a boolean value (read only) indicating whether there are any pending load requests.
@@ -312,7 +322,7 @@ In the fashion similar to ngRepeat the following animations are supported:
312
322
* .enter - when a new item is added to the list
313
323
* .leave - when an item is removed from the list
314
324
315
-
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
325
+
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 AngularJS animations apply. Look [here](http://rawgit.com/angular-ui/ui-scroll/master/demo/animation/animation.html) for an example of animations in the scroller
0 commit comments