{"action":"created","issue":{"url":"https://api.github.com/repos/RubaXa/Sortable/issues/255","labels_url":"https://api.github.com/repos/RubaXa/Sortable/issues/255/labels{/name}","comments_url":"https://api.github.com/repos/RubaXa/Sortable/issues/255/comments","events_url":"https://api.github.com/repos/RubaXa/Sortable/issues/255/events","html_url":"https://github.com/RubaXa/Sortable/issues/255","id":56285201,"number":255,"title":"Drag and drop gives an error with Angular 1.3.* when you have debugInfo disabled.","user":{"login":"vikasgarghb","id":4420833,"avatar_url":"https://avatars.githubusercontent.com/u/4420833?v=3","gravatar_id":"","url":"https://api.github.com/users/vikasgarghb","html_url":"https://github.com/vikasgarghb","followers_url":"https://api.github.com/users/vikasgarghb/followers","following_url":"https://api.github.com/users/vikasgarghb/following{/other_user}","gists_url":"https://api.github.com/users/vikasgarghb/gists{/gist_id}","starred_url":"https://api.github.com/users/vikasgarghb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vikasgarghb/subscriptions","organizations_url":"https://api.github.com/users/vikasgarghb/orgs","repos_url":"https://api.github.com/users/vikasgarghb/repos","events_url":"https://api.github.com/users/vikasgarghb/events{/privacy}","received_events_url":"https://api.github.com/users/vikasgarghb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-02T19:59:40Z","updated_at":"2015-02-06T09:21:26Z","closed_at":null,"body":"Hi, I am using `ng-sortable` with angular 1.3.* and have debugInfo disabled for production. But doing so, gives a JS error `Uncaught TypeError: Cannot read property 'indexOf' of undefined`. The error is on this line in `ng-sortable.js`, `oldIndex = prevItems.indexOf(prevSource.item(evt.item));`. I debugged it and found that the actual issue arise on this line in `ng-sortable.js`,\r\n`var scope = angular.element(el).scope();`\r\n\r\n`scope` returned here is `undefined`. According to this, https://docs.angularjs.org/api/ng/function/angular.element `scope()` method will return `undefined` when debugInfo is disabled. Enabling the debugInfo in production is not an option for me as this would cause some performance overhead in our application. Here is more information on disabling debugInfo https://docs.angularjs.org/guide/production#disabling-debug-data"},"comment":{"url":"https://api.github.com/repos/RubaXa/Sortable/issues/comments/73208814","html_url":"https://github.com/RubaXa/Sortable/issues/255#issuecomment-73208814","issue_url":"https://api.github.com/repos/RubaXa/Sortable/issues/255","id":73208814,"user":{"login":"RubaXa","id":1109562,"avatar_url":"https://avatars.githubusercontent.com/u/1109562?v=3","gravatar_id":"","url":"https://api.github.com/users/RubaXa","html_url":"https://github.com/RubaXa","followers_url":"https://api.github.com/users/RubaXa/followers","following_url":"https://api.github.com/users/RubaXa/following{/other_user}","gists_url":"https://api.github.com/users/RubaXa/gists{/gist_id}","starred_url":"https://api.github.com/users/RubaXa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RubaXa/subscriptions","organizations_url":"https://api.github.com/users/RubaXa/orgs","repos_url":"https://api.github.com/users/RubaXa/repos","events_url":"https://api.github.com/users/RubaXa/events{/privacy}","received_events_url":"https://api.github.com/users/RubaXa/received_events","type":"User","site_admin":false},"created_at":"2015-02-06T09:21:26Z","updated_at":"2015-02-06T09:21:26Z","body":"I do not know how to fix it, alas."}}