When the event fires and $scope.lazyLoadDelegate.refresh is called I get an error that refresh method is undefined.
Examining the $scope.lazyLoadDelegate variable in the debugger shows that the refresh method is indeed not there
Also when I put breakpoints in any delegate methods they are not hit.
I use Onsen UI v 2.10.5 and Angular.js v1.6.9
What am I missing??
Thanks
Andy

I’m not that familiar with the AngularJS compilation process, but the short answer is that the code in the controller is run before the onsLazyRepeat directive is compiled. When onsLazyRepeat is compiled, it exposes the refresh method so any code in the controller that runs immediately won’t be able to use refresh.

I think the solution is to check when the EventManager.EVT_ALL_ITEMS_FETCHED event is firing - it must be before compilation has happened.

Let me know if this isn’t enough information to solve the problem and I will look into the compilation process in more detail.

The refesh method is not used immediately but only when the data is loaded from the server which takes at least a couple of seconds
Also I made a test where I just basically do exactly as in the sample i.e set the item count to some number, i.e 100, and in configurItemScope just do

itemScope.item = "item" + index;

Still the list is empty.
Perhaps it’s some library that I’m missing? Or version incompatibility?
Thanks
Andy

The only thing I can think of right now is that your code uses $scope whereas the playground example is using Controller as controller to reference the scope. Either is fine but both can cause problems so it’s worth checking they’re not accidentally both getting used somewhere.

From the code you provided, I can’t see what would be causing the problem.

Do the list items themselves show up? (i.e. you get ‘Item 1’, ‘Item 2’, ‘Item 3’, not ‘{{ item }}’). If the list items don’t show up it’s probably because Onsen isn’t loaded properly or you have a typo somewhere.

I don’t think it’s an Onsen version problem because I tried 2.10.1, 2.10.5 and 2.10.6 and they all worked for me.

I also don’t think it’s caused by using angular.module instead of ons.bootstrap because I got it working fine with angular.module.

There are a few other things you might be able to try:

If it’s an open source project, put the project on GitHub and I’ll clone it and take a look at it.

If it’s not an open source project but you don’t mind sharing some of the code, make the smallest possible working example and put it on GitHub.

This is not an open source project .
One thing that I’m suspicious of is the way the project is set up.
It started as a Monaca project online IDE but then was copied locally and development continued. So the project index.html file does not inclde onsenui.js,angular.js etc. but instead includes loader.js
However all other framework elements work just fine. The project uses ons-list, ons-tabbar, ons-navigator, ons-modal, etc and everything works,lazy-repeat is the only one thing that does not.
Perhaps I neeed to revisit the way the project is organized ,get rid of the loader.js and use standard onsenui.js, angular.js and whatever else may be needed.
Can you point me to a sample Onsen Angular JS skeleton project?
Thanks
Andy

Thank you so much for pointing me to that tool. I was able to get the lazy list to work - created a skeleton Angular JS project,added the lazy load sample code to it and it worked!
However here is another problem.
It only works if the app is bootstrapped with my app=ons.bootstrap()…etc etc, like in the sample. My app is structured differently. I have a main module that is defined like this