koorgoo / ngCropper

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

Update cropper when options.aspectRatio changed. #34

Open blutarche opened 8 years ago

blutarche commented 8 years ago

Added below script inside ngCropper directive in dist/ngCropper.all.js

scope.$watch('options.aspectRatio', function() {
  element.cropper('destroy').cropper(scope.options);
}, true);
srinivasaltair commented 7 years ago

@koorgoo Above code is very helpful and it works as expected please accept the pull request so that we can directly use it from boweror npm install without changing the repo code.

I had a question #36 regarding the issue, but this script helped me fix it.

Thanks in advance & @blutarche Thanks