Ionic - load image from ipad filesystem

I am building an Ionic app for iPad. One of the requirements is to open a PNG Image in the app.

I am using $cordovaFile.readAsDataURL to read the image from iPad filesystem and show in the app, however, it goes into some kind of infinite loop.

In my html

<div style="text-align:center;">
          <img ng-src="{{getDoc(item.fileName)}}" width="100%" height="auto">

In the controller

$scope.getDoc = function (fileName) {
return $cordovaFile.readAsDataURL(cordova.file.dataDirectory, $rootScope.username + "/thb/" + fileName + ".png")
                    .then(function (success) {
                        console.log("success", JSON.stringify(success));
                        return success;

                    }, function (error) {
                        console.log("error....", JSON.stringify(error));

The output in safari developer tools shows that it has gone into some kind of infinite loop, as the output never ends It looks like (small snippet)


It keeps on printing this again and again. How can I read a png file from iPad file system and show it in the Ionic app.

I have also tried readAsDataURL but with the same result.