andrefarzat / ng-jcrop

Angular directive to jCrop jQuery plugin
GNU General Public License v2.0
101 stars 39 forks source link

Conflict when have multi upload inputs #60

Closed ducthang310 closed 7 years ago

ducthang310 commented 7 years ago

I add two upload inputs on the same page and got an error:

"$rootScope.$broadcast" is reason for all upload inputs are changed. And currently, I have changed the code to: $scope.$broadcast

screen shot 2016-12-16 at 1 10 42 pm

It's good for me. And I hope it's fine with you. If this solution is not correct (has some potential bugs). Please help me to check it or fix it. Thank you so much! p/s: My english is so bad, I'm so sorry for that :-D

andrefarzat commented 7 years ago

hello @ducthang310 , you can see in the demo (http://andrefarzat.github.io/ng-jcrop/) that we have several instances running side by side. It's possible to name a configuration to each case, therefore, you can have these instances behaving individually.

The directive which does that is ng-jcrop-config-name="configName". Please, have a look in the README.md.

Hope it helped 😄

ducthang310 commented 7 years ago

Hi Andrefarzat, This issue is still occur when I use ng-jcrop-config-name with different configName, "$rootScope.$broadcast" is reason for all Upload inputs are changed. The demo (http://andrefarzat.github.io/ng-jcrop/) has only one Upload input. If you have multi Upload input, you'll see the error.

Thank you for your help!

andrefarzat commented 7 years ago

@ducthang310 true. I haven't checked that there are two upload inputs. Will implement it in the demo page, so I can see it happening here 😃

andrefarzat commented 7 years ago

@ducthang310 the demo now is updated with a functional example: http://andrefarzat.github.io/ng-jcrop/