AngularJS directive cropimg
Hi,
As I'm working on an AngularJS project now, I'm trying to get your plugin to work. After some digging, I found that below directive does most of the work.
However, when I get in the loader.onload() method, the width() and height() functionality of jQuery are not available anymore. So I changed it to image[0].width and image[0].height, which solves my problem, but it doesn't seem appropriate. Do you have an idea why I lost these functionalities in the onload() method?
app.directive('imageCropper', function () { return { restrict: 'A', link: function (scope, iElement, iAttrs) { iElement.cropimg({ resultWidth: 600, resultHeight: 400, inputPrefix: 'ci-' }); } } });
I'm sad to tell You i've never work with AngularJS and i have no idea how it works. Plugin wan's tested with this library. I don't know how to help You with this problem.
Where you gets sizes of image and what for? Where You changed this code, in plugin src?
OK cool.
I changed it in the plugin source, where originalimage is set.
2015-07-31 13:05 GMT+02:00 Adam [email protected]:
I'm sad to tell You i've never work with AngularJS and i have no idea how it works. Plugin wan's tested with this library. I don't know how to help You with this problem.
Where you gets sizes of image and what for? Where You changed this code, in plugin src?
— Reply to this email directly or view it on GitHub https://github.com/requtize/cropimg/issues/10#issuecomment-126655034.
Ok. What's broken when You change this plugin code?
Nothing, I got it working, but it doesn't feel like a correct solution.
I dont have an explanation why width () is not available in the onload method. Op 31 jul. 2015 13:58 schreef "Adam" [email protected]:
Ok. What's broken when You change this plugin code?
— Reply to this email directly or view it on GitHub https://github.com/requtize/cropimg/issues/10#issuecomment-126668337.