Lazy load dynamic images?

I want to be able to lazy load images that users upload in my message app to speed it up.

I’ve followed this tutorial to the letter, but when the app laods I just get a black screen. The only difference is the my app has a dynmaic link for the pictures - is it possible?

<img-loader [src]="{{group.img}} useImg"></img-loader>


Leaving aside the fact that this lacks an ending quote, it doesn’t make sense, and frankly I’m surprised it doesn’t throw an error.

[src]="foo" means "set the src property to whatever is in the controller property named foo".

src="{{foo}}" means “set the src property to whatever the stringified version of the controller property named foo is” (which, when you’re dealing with DOM sanitization, is a deceptively bad idea).

[src]="{{foo}}" is just bananas.

sorry, I don’t understand.

The original code (which works) is

<img src="{{group.img}}"/>

group.img is the name of the image that the user uploads and gets pulled through and displayed.