New issue
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
Not compatible with angular 1.3-beta #120
Comments
also not compatible with angular 1.3.rc-3 |
@codef0rmer , any plans to become 1.3 compatible? |
👍 for Angularjs 1.3 compatibility |
Does anybody have a demo to state a problem? For me, it works even with 1.3+ |
I found the cause : inserting the script jquery.ui.js after angular.js cause the issue in 1.3 but not 1.2. Specially if the drag or drop directive is used with ngRepeat. On removing the element by $animate.leave , the drag or drop plugin get destroyed by the 'remove' event before the $destroy event. Play way this forked Demo: http://plnkr.co/edit/uiwZhsSmdtDebB4ZaRWT |
I was using this hack : |
@laplantb: This |
Sorry I used the same logic as jqueryui before it throws the exception (look around line 507 of jqueryui.js (1,11,1)). I assumed $.data is used for public access but was wrong. If you look at line 502, element.draggable('instance') would return the instance. I dunno if it works with old versions of jqueryui though. |
@laplantb: I noticed that the draggable/droppable was initialized but still throwing the error on destroy. That's why I call it a hack :-) |
Using
angular 1.3-beta.15
jQuery 2.1.1
jQueryUI 1.9.1
ngDragDrop 1.0.7
Loading the page and using the drag-drop feature is not an issue until a route change is performed. The following error is fired:
Error: cannot call methods on draggable prior to initialization; attempted to call method 'destroy':
Error: cannot call methods on draggable prior to initialization; attempted to call method 'destroy'
at Function.jQuery.extend.error (http://localhost:9000/bower_components/jquery/dist/jquery.js:250:9)
at HTMLDivElement. (http://localhost:9000/bower_components/jquery-ui/ui/jquery-ui.js:487:15)
at Function.jQuery.extend.each (http://localhost:9000/bower_components/jquery/dist/jquery.js:375:23)
at jQuery.fn.jQuery.each (http://localhost:9000/bower_components/jquery/dist/jquery.js:139:17)
at $.fn.(anonymous function) as draggable
at HTMLDivElement. (http://localhost:9000/bower_components/angular-dragdrop/src/angular-dragdrop.js:278:19)
at HTMLDivElement.jQuery.event.dispatch (http://localhost:9000/bower_components/jquery/dist/jquery.js:4409:9)
at HTMLDivElement.elemData.handle (http://localhost:9000/bower_components/jquery/dist/jquery.js:4095:28)
at Object.jQuery.event.trigger (http://localhost:9000/bower_components/jquery/dist/jquery.js:4324:12)
at jQuery.fn.extend.triggerHandler (http://localhost:9000/bower_components/jquery/dist/jquery.js:4881:24) angular.js:10264
(anonymous function) angular.js:10264
(anonymous function) angular.js:7506
Scope.$digest angular.js:12654
Scope.$apply angular.js:12873
(anonymous function) angular.js:10052
jQuery.event.dispatch jquery.js:4409
elemData.handle jquery.js:4095
The text was updated successfully, but these errors were encountered: