Angular ng-src unable to load image from device on --livereload mode

What im trying to achieve :

When the user clicks on a image placeholder the image is downloaded from the server to the device (to a specific location) , the downloaded image path is then stored in the $socpe and displayed to the user .

Below is my contorler

.controller('NDetailCtrl', function($scope, $state,$stateParams,$ionicLoading,$ionicHistory,$timeout,$cordovaFile,$cordovaFileTransfer) {

    $scope.image = '';

    // triggered on click
    $scope.downloadFile = function(image) {

    var url = ""+image ;
    var filename = url.split("/").pop();

    var targetPath = cordova.file.externalRootDirectory+filename;
    var trustHosts = true;
    var options = {};

$, targetPath, options, trustHosts)
  .then(function(result) {

    // Success!


    $scope.resource =  result.nativeURL;
    // This return the file location as
    // file:///storage/emulated/0/[filename]
    $scope.image = true;


  }, function(error) {
    // Error
    alert('Error : Some Thing went wrong !');

  }, function (progress) {
    $timeout(function () {
      $scope.downloadProgress = (progress.loaded / * 100;



I have whitelist config as well this one is inserted inside diviceready event


When i try to load the returned path using ng-src it doesn’t display any thing , just a blank white space .

Can I ask why they need to download the images in the first place? Why not just stick your static images on S3 or include them within your app, and just reference them that way?

But to answer your question, are you sure you are setting the correct scope variable to the image’s file location? It looks like your are setting image = true, and if you are using ng-src=image, that would be the issue.

The Application supposed to download images from web and store in device storage . i have all the required app images in assets :)blush:

The issue is fixed . i had some bad coding . Now i can view the downloaded image in device but on – livereload mode the problem still persists .