You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In documentation in configuration section we have information about onError and onSuccess function which should receive image paramater. But I cannot find description of the parameter in documentation.
angular.module('your.module', [
'angularLazyImg'
]).config(['lazyImgConfigProvider', function(lazyImgConfigProvider){
var scrollable = document.querySelector('#scrollable');
lazyImgConfigProvider.setOptions({
offset: 100, // how early you want to load image (default = 100)
errorClass: 'error', // in case of loading image failure what class should be added (default = null)
successClass: 'success', // in case of loading image success what class should be added (default = null)
onError: function(image){}, // function fired on loading error
onSuccess: function(image){}, // function fired on loading success
container: angular.element(scrollable) // if scrollable container is not $window then provide it here
});
}])
The text was updated successfully, but these errors were encountered:
I found that the image parameter doesn't contain any information about an angular scope. I probably cannot get information about DOM element too.
I found additionally that I must myself run $scope.apply() to get information about class change. I attach to events with $rootScope.on('lazyImg:error') and $rootScope.on('lazyImg:success'), in which functions I run $scope.apply().
In documentation in configuration section we have information about onError and onSuccess function which should receive image paramater. But I cannot find description of the parameter in documentation.
The text was updated successfully, but these errors were encountered: