danmasta / ng-lazyload

Angular module for lazyloading images in your angular js applications.
MIT License
4 stars 0 forks source link

Hi, what about iterator configuration (callback) to occur always after loading the image? To run some functions like Masonry. #1

Open friktor opened 9 years ago

friktor commented 9 years ago

Just at the moment, this Directive is a very pleasant alternative to the jquery lazyload - and would like to have some "sugar" in this implementation.

friktor commented 9 years ago

In this matter I do not mean the creation of the Directive - with this function. But that was the option callback (iterator) - without the need to create a Directive.

danmasta commented 9 years ago

Hi @friktor,

I'm trying to understand what you mean, are you looking for a callback to be run, using an angular expression?

<div lazyload="some-url.filetype" lazyload-callback="updateMasonry()"></div>

Currently, you can inject the service into a custom directive and run a function when the loading is complete.

friktor commented 9 years ago

Yes I mean something similar, I think it would be a very useful feature, at least because someone is too lazy to write for his application unnecessary Directive for processing the loaded image.

danmasta commented 9 years ago

Yeah I see what you mean. I'm thinking a callback for success and error would be a good addition. Something like this:

<div lazyload="some-url.filetype" lazyload-success="updateMasonry()"></div>
<div lazyload="some-url.filetype" lazyload-error="notify()"></div>

What do you think?

friktor commented 9 years ago

Yes this is a very very good idea )