How to display selected image from gallery?


#1

Hi!

Here are code:

$scope.selImages = function() {
  
      document.addEventListener("deviceready", function () {

        var options = {
                        quality: 50,
                        destinationType: Camera.DestinationType.DATA_URL,
                        sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
                        targetWidth: 100,
                     };

        $cordovaCamera.getPicture(options).then(function(imageData) {
          $scope.image = imageData;
          
          }, function(err) {
              // error
          });
      })
  }

    <div>
      <img class="pix-zone-pix" ng-src="{{image}}"/>
    </div>

and the answer on image

so how to display selected image? or imageData(url)?


#2

na ok :slight_smile: so change the

destinationType: Camera.DestinationType.DATA_URL, to destinationType:Camera.DestinationType.FILE_URI

and delete the comma :slight_smile: end of line :slightly_smiling: