We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.html
<div class="form-group"> <input class="form-control animate-show" type="file" id="mainImage" name="mainImage" onchange="angular.element(this).scope().setFiles(this)" multiple> <div class="cropArea animate-show img-responsive" ng-show="myImage" ng-repeat="image in myImage"> <img-crop id="myImage" area-min-size="100" image="image" result-image="files[$index]" result-image-format="image/jpeg" result-image-size="200"> </div> <div ng-show="files" class="animate-show">Cropped Image:</div> <div ng-show="files" class="animate-show"> <img ng-repeat="file in files" ng-src="{{file}}" style="max-height:100px;" /> </div>
<div
<input
onchange="angular.element(this).scope().setFiles(this)"
myImage">
<img-crop
result-image-format="image/jpeg"
</div>
Image:</div>
<img
2.angular $scope.setFiles = function (evt) { $scope.myImage = []; angular.forEach(evt.files, function (item) { var file=item; var reader = new FileReader(); reader.onload = function (evti) { $scope.$apply(function($scope){ $scope.myImage.push(evti.target.result); $scope.files.push(evti.target.result); }); }; reader.readAsDataURL(file); }); };
The text was updated successfully, but these errors were encountered:
It's working for me and i share for you.
Sorry, something went wrong.
No branches or pull requests
1.html
<div
class="form-group"><input
class="form-control animate-show" type="file" id="mainImage" name="mainImage"onchange="angular.element(this).scope().setFiles(this)"
multiple><div
class="cropArea animate-show img-responsive" ng-show="myImage" ng-repeat="image inmyImage">
<img-crop
id="myImage" area-min-size="100" image="image" result-image="files[$index]"result-image-format="image/jpeg"
result-image-size="200"></div>
<div
ng-show="files" class="animate-show">CroppedImage:</div>
<div
ng-show="files" class="animate-show"><img
ng-repeat="file in files" ng-src="{{file}}" style="max-height:100px;" /></div>
2.angular
$scope.setFiles = function (evt) {
$scope.myImage = [];
angular.forEach(evt.files, function (item) {
var file=item;
var reader = new FileReader();
reader.onload = function (evti) {
$scope.$apply(function($scope){
$scope.myImage.push(evti.target.result);
$scope.files.push(evti.target.result);
});
};
reader.readAsDataURL(file);
});
};
The text was updated successfully, but these errors were encountered: