browse other examples

Adapter On Controller

There may be some nested scopes between the ui-scroll and the controller where you want the adapter object to be injected. As it follows from the documentation, adapter="expression on controller" format can be used to explicitly specify the scope associated with the specified controller as the target scope for the injection.
<div ui-scroll="item in datasource" adapter="adapter on mainController">{{item}}</div>
In this sample we have ng-if wrapper over the viewport which causes an intermediate scope. "Is loading" will not work without specifying the controller through the "on controller" syntax .
Is loading: