1 var fileURL = "assets/"+scope.productDirectory+"/content1/info/"+x+".png";
2 imageExists(fileURL, function(exists, url) {
3 if(exists) {
4 scope.contentOneSequence.push(url);
5 }
6 });
7
8 function imageExists(url, callback) {
9 var img = new Image();
10 img.onload = function() { callback(true, url); };
11 img.onerror = function() { callback(false, url); };
12 img.src = url;
13 }
14