خرید بک لینک

Vote count: 0

I want to take photos of different items or multiple photos for one item, but I am struggling to figure out how I will be able to push the images into an array.

a single image gets displayed from the first line :

<img ng-show="imgURI !== undefined" ng-src="{{imgURI}}" style="text-align: center">

but with the ng-repeat it doesn't display one image.

I quess my issues are:

  1. what is wrong with my ng-repeat?
  2. are the images actually being stored inside of the array correctly?

HTML

 <button class="button button-full button-assertive" ng-click="takePhoto()">
    Take Photo
    </button>
    <img ng-show="imgURI !== undefined" ng-src="{{imgURI}}" style="text-align: center">
<ion-item class="item item-assertive">Test array</ion-item>
 <div ng-repeat="x in array">
     <img ng-src="{{x.imgURI}}">
 </div> center">

Javascript

  $scope.takePhoto = function () {
              var options = {
                quality: 75,
                destinationType: Camera.DestinationType.DATA_URL,
                sourceType: Camera.PictureSourceType.CAMERA,
                allowEdit: true,
                encodingType: Camera.EncodingType.JPEG,
                targetWidth: 300,
                targetHeight: 300,
                popoverOptions: CameraPopoverOptions,
                saveToPhotoAlbum: false
            };

                $scope.array = [];

                $cordovaCamera.getPicture(options).then(function (imageData) {
                    $scope.imgURI = "data:image/jpeg;base64," + imageData;
                    $scope.imgURI = array;
                }, function (err) {
                    // An error occured. Show a message to the user
                });
            }

asked 9 mins ago

1 Answer

Vote count: 1

You are setting the imageUri to the value of the array.

$scope.imgURI = ar;

I think you want to do a push on the array like this:

$scope.array.push($scope.imgURI);

answered 3 mins ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 18 خرداد 1395 ساعت: 16:18

صفحه بندی