angular-ui / ui-scroll

Unlimited bidirectional scrolling over a limited element buffer for AngularJS applications
http://angular-ui.github.io/ui-scroll/demo/
MIT License
327 stars 107 forks source link

How to know if adapter is created? #183

Closed dhilt closed 6 years ago

dhilt commented 6 years ago

Let's say we have a template:

<ul ui-scroll-viewport class="viewport">
  <li ui-scroll="item in datasource" adapter="adapter">
    <span>{{item.content}}</span>
  </li>
</ul>

So how to know if the Adapter is created?

dhilt commented 6 years ago

The simpliest way is to $watch for $scope.adapter property:

$scope.$watch('adapter', () => {
  console.log($scope.adapter);
});