Ng-lazyload-image: Could you add loadStart event output?

Created on 30 Nov 2019  ·  4Comments  ·  Source: tjoskar/ng-lazyload-image

I need a loadstart event to highlight an element when src has been changed until image loading is done.
Also could you define the exportAs to parameter. It would be great to use the props in the template.

help wanted

All 4 comments

I sound like a narrow use case but I could accept it :) I guess we need to add a tap function between these two lines:
https://github.com/tjoskar/ng-lazyload-image/blob/d45e55b481dfad5fd50317bbc57b216248e554df/src/lazyload-image.ts#L16-L17

And pass down a output property.

Also could you define the exportAs to parameter

Sure. I don't have the time right now but I will accept PRs :)

@tjoskar thanks, I can develop in a few weeks 👍

I'm thinking of changing the outout onLoad to onStateChange or simmular and pass all type of events there. Maybe with the signature:

interface StateChangeEvent {
  reason: 'setup' | 'observer-emit' | 'start-loading' | 'loading-failed' | 'loading-succeeded'
}
function onStateChange(event: StateChangeEvent) {

}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

AzerHeshim picture AzerHeshim  ·  5Comments

sandeepdussa picture sandeepdussa  ·  9Comments

tjoskar picture tjoskar  ·  4Comments

philipgiuliani picture philipgiuliani  ·  11Comments

stratio84 picture stratio84  ·  6Comments