Show an Ionic 1 Spinner While Online Images Load

I can has more kitten GIFs plz?

Lee Nathan
One Tap Software
1 min readDec 12, 2016

--

Create a directive to execute a function once the image loads:

Add a reveal function to your controller:

This example assumes you don’t have a loaded variable in your kitten object.
Add the directive and hide your image:

Then add your spinner and show it until the image is loaded:

Add the text-center class to your li if you want to center your spinner.

--

--

Lee Nathan
One Tap Software

Freelance Writer for Hire and Personal Development Advocate