Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect when image has loaded in img tag

Tags:

angular

I am using Angular 2 and I need to detect if an image has loaded in an image tag.

Is there an event for that?

Something like this :

<img [src]="imagesource" [loaded]="dosomething()"> 
like image 681
doorman Avatar asked Aug 31 '16 19:08

doorman


People also ask

How check image is loaded or not in jQuery?

To check if an image is loaded successful or not, you can combine the use of jQuery 'load()' and 'error()' event : $('#image1') . load(function(){ $('#result1'). text('Image is loaded!


1 Answers

<img [src]="imagesource" (load)="dosomething()"> 
like image 180
Günter Zöchbauer Avatar answered Sep 30 '22 00:09

Günter Zöchbauer