koorgoo / ngCropper

AngularJS wrapper for https://github.com/fengyuanchen/cropper
107 stars 72 forks source link

ngCropper on load new image -> not working #33

Open djpysu opened 8 years ago

djpysu commented 8 years ago

When I try to upload a second image, it's not working - the cropper remains with the first image.

jayquest commented 8 years ago

@djpysu I found a solution on the #22

I changed the method onFile and solved. See:

$scope.onFile = function (blob) {
        Cropper.encode((file = blob)).then(function (dataUrl) {
            $scope.dataUrl = dataUrl;
            $timeout(hideCropper);
            $timeout(showCropper);  // wait for $digest to set image's src
        });
    };