Pentiado/angular-lazy-img

Event after image has been downloaded

brazorf opened this issue · 1 comments

I've seen this already #10

However i've noticed that the success event is triggered before the actual download. What i'm trying to do is to add an img-responsive class after the download, otherwise my gif spinner is upscaled and deformed.

$rootScope.$on('lazyImg:success', function(event, data){
	debugger;
	angular.element(element[0].querySelector('img')).addClass('img-responsive');
});

Is it there any way to do this, and is this library still maintained?

Nevermind, i've figured it out.

module.config(function(lazyImgConfigProvider){
		lazyImgConfigProvider.setOptions({
			successClass: 'img-responsive' // in case of loading image success what class should be added (default = null)
		});
	});