How to set downloaded image from AWS as an image via ng-src


Hello everyone!
So I’ve been writing an app, which downloads images from AWS and sets it in the view, as

The code I am using is below:
function DownloadImages($localstorage, $cordovaFile, $ionicPlatform, $ionicLoading) {
var vm = this;
var test = {};

    vm.createDirectoryForImages = function (directory) {
        $ionicPlatform.ready(function () {
        }).then(function () {
            $cordovaFile.createDir(cordova.file.dataDirectory, directory, true)
                .then(function (entry) {

                }, function (error) {
                    alert("Could not create directory: " + error.status);
    }; = function (directory, filename) {
            template: '<ion-spinner icon="spiral"></ion-spinner> </br>Downloading...'
        var hike = JSON.parse($localstorage.get("hikelistandinformation"));
        var url = hike.photosUrl + "1.png";
        $ionicPlatform.ready(function() {
        }).then(function() {
            var ft = new FileTransfer();
  , cordova.file.dataDirectory + directory + "/" + filename, function successfullyDownloaded(entry) {
                return entry.toURL();
            }, function error(error) {
                alert("Download error: " + error);
            }, true, {});

        //, cordova.file.dataDirectory + "LanikaiPillbox")

However, whenever I try to set the image source as the entry url, nothing appears on the view. I have tried toInternalURL(), and fullPath(), but nothing seems to work.

Any advice would be greatly appreciated! Thanks in advance!


Turns out my code was perfectly fine. It was a problem with the emulator.
I am using Genymotion, and I ran my app using the command, “ionic run android -l c -s” and apparently emulators don’t have the ability to get from native directories.
I ran it on my actual device, and the image shows. For anyone else that runs into the same problem that I just encountered, try to install and run your app on your phone!