Pentiado / angular-lazy-img

Lightweight lazy load images plugin. Only 1kb after gziping. Pure JavaScript, only Angular as dependency.
MIT License
178 stars 66 forks source link

Changes to img source value in lazy-img attribute not being picked up #42

Open kiwikoda opened 6 years ago

kiwikoda commented 6 years ago

After first assigning an image source to the lazy-img attribute, subsequent changes to the attribute value are not picked up.

I think this used to work and would be a good feature.

Reversing change https://github.com/Pentiado/angular-lazy-img/pull/19/commits/e33b01141b13e5ee9c086e83639a8fd1ba409e40 (i.e. removing the deregister() call that was added inside the attribute observer) fixes the issue.

craig-o-curtis commented 6 years ago

I'm having the same issue -- Using $onChanges lifecycle, changes recognized but $rootScope.$emit('lazyImg:refresh'); doesn't cause repopulation of src attribute.