Hey there!
I've created a list with lazy loading images, I have more than 700 images
and I'm showing them in a scrolling div.
The lazy loading works pretty good in my opinion.
I have two directives : one which loads the on.('scroll') which sends a
'$broadcast' and the children which (the last one) sends an '$emit' (the
images themselves) (see plnkr)
and I have two issues as well :
- When I filter the list I'm losing the changes I made at the beginning.
For example (try it in plnkr), if you write 'name_9' (something that is not
visible when loading for the first time) you'll see that the
'triggerHandler' is not being executed so I can't see the images, but after
scrolling is working normally again (which I think it makes some kind of
sense since the filter is recreating the children, not the parent div).
- Every time I filter or remove the filter the list is recreated (yes,
again, but another issue) but it doesn't keep the changes. For example,
let's say you scroll to the 10th image (name_10), if you filter and remove
the filter the previously loaded images are lost (inspect the code and
you'll see).
So my questions are related to those issues :
- How do I execute the triggerHandler (to simulate the first scroll) when
filtering? I know that the directive lazyScrollLast doesn't participate of
the filtering and recreating, how to make it part of it?.
- How do I keep the changes made to the DOM when scrolling and filtering?
Because this is reloading every image, no matter how many times I've seen
it before when scrolling.
This is the plnkr http://plnkr.co/edit/XYjVqce85YgYmwuxE9sZ?p=preview
Any advice will be appreciated. I hope you can guide me and tell me what to
read.
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.