title: Ionic 2 / Ionic 3 / Ionic 4 : (Lazy) Loading spinner for pictures
body: <p>I'm using ion-img in my ionic2 application to load my pictures correctly. However, I wonder if there is a way to indicate to the user that the picture is actually loading.</p>
  
  <p>Thank you for your help!</p>
  
  <p><strong>EDIT : Here is the answer if you absolutely need to use the ion-img tag. If not, you should use <a href="https://www.npmjs.com/package/ionic-image-loader" rel="nofollow noreferrer">ionic-image-loader</a> as <a href="https://stackoverflow.com/users/7762525/admindev826">AdminDev826</a> suggested.</strong></p>
  
  <p>I finally solved that problem with CSS! When an image is loading in ionic 2, the ion-img tag doesn't have any class. However, when the image is finally loaded, the ion-img tag get the class "img-loaded".</p>
  
  <p>Here is my solution :</p>
  
  <pre><code>  &lt;ion-img [src]="img.src"&gt;&lt;/ion-img&gt;
    &lt;ion-spinner&gt;&lt;/ion-spinner&gt;
  </code></pre>
  
  <p>And my CSS :</p>
  
  <pre><code>.img-loaded + ion-spinner {
    display:none;
  }
  </code></pre>
  
  <p>I hope it can help someone!</p>