I created a mobile application using an ionic frame. It contains many images. I need to download all the images without flickering. So I used $ImageCacheFactoryto preload all the images by specifying this blog .
I used below code. The problem is that the application contains 100 pngimages, so I need to transfer all png files.
.run(function($ImageCacheFactory) {
$ImageCacheFactory.Cache([
"img/user.png",
"img/profile.png",
"img/logo.png",
"img/splash.png",
"img/map.png",
"img/shop.png",
"img/country.png",
"img/place.png"
]).then(function(){
console.log("Images done loading!");
},function(failed){
console.log("Error..!!!");
});
})
Is there any simple way to link to all png images using a single line code (all images are in a folder www/img). thanks