Synchronization in AngularJS (IONIC Framework)

I am using Cordova file transfer plugin to download the image in the internal storage of mobile. I want to access the nativeUrl of the downloaded photo. But when I am trying to download the image on its success, I want to store some more information along with native Url. This following function is in loop. It does not wait till the success of the image and it and loop is completed. The image is downloaded later but the information on its success is lost. Here is my code

        $cordovaFileTransfer.download(options.photoUrl, targetPath, str, trustHosts)
         .then(function(result) {
         var returnObject={};
         console.log("result->" + result);
         returnObject.nativePhotoUrl=result.nativeURL;
         returnObject.photoUrl = options.photoUrl;
         returnObject.caption = "Get such updates for you at www.mysite.com";
         returnObject.link = $scope.getShareLinkFromArtifact(parsedArtifactSummery);
         return returnObject;
        }, function(err) {
        console.log("error->" + err);
       });

Please give me solution.