{"action":"created","issue":{"url":"https://api.github.com/repos/a5hik/ng-sortable/issues/197","labels_url":"https://api.github.com/repos/a5hik/ng-sortable/issues/197/labels{/name}","comments_url":"https://api.github.com/repos/a5hik/ng-sortable/issues/197/comments","events_url":"https://api.github.com/repos/a5hik/ng-sortable/issues/197/events","html_url":"https://github.com/a5hik/ng-sortable/issues/197","id":99276342,"number":197,"title":"Uncaught TypeError: $scope.modelValue.splice is not a function","user":{"login":"tino415","id":7475061,"avatar_url":"https://avatars.githubusercontent.com/u/7475061?v=3","gravatar_id":"","url":"https://api.github.com/users/tino415","html_url":"https://github.com/tino415","followers_url":"https://api.github.com/users/tino415/followers","following_url":"https://api.github.com/users/tino415/following{/other_user}","gists_url":"https://api.github.com/users/tino415/gists{/gist_id}","starred_url":"https://api.github.com/users/tino415/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tino415/subscriptions","organizations_url":"https://api.github.com/users/tino415/orgs","repos_url":"https://api.github.com/users/tino415/repos","events_url":"https://api.github.com/users/tino415/events{/privacy}","received_events_url":"https://api.github.com/users/tino415/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-05T19:10:15Z","updated_at":"2015-10-16T21:29:08Z","closed_at":null,"body":"This I get on drop, I'm using controller as syntax.\r\n\r\nMy template:\r\n\r\n````html\r\n <ul class=\"nav navbar-nav navbar-right\" as-sortable=\"NCtrl.sortableFunctions\" ng-model=\"NCtrl.pages\">\r\n    <li ng-repeat=\"page in NCtrl.pages\"\r\n            as-sortable-item\r\n           data-match-route=\"edit/{{page.page.template}}/{{page.page.link}}\"\r\n        >\r\n        <a as-sortable-item-handle href=\"#edit/{{page.page.template}}/{{page.page.link}}\">\r\n            {{page.page.title}}\r\n        </a>\r\n    </li>\r\n\r\n    <!--\r\n    <li ng-repeat-end class=\"navbar-btn\" ng-show=\"NCtrl.editMode\">\r\n        <button class=\"btn btn-danger\" ng-click=\"NCtrl.remove(page.id)\">Remove</button>\r\n    </li>\r\n    -->\r\n</ul>\r\n````\r\n\r\nSortable functions:\r\n\r\n```js\r\nvm.sortableFunctions.orderChanged = function() { console.log('order change');}; // triggered when item order is changed with in the same column.\r\nvm.sortableFunctions.itemMoved = function() { console.log('order change');}; // triggered when an item is moved accross columns.\r\nvm.sortableFunctions.dragStart = function() { console.log('order change');};// triggered on drag start.\r\nvm.sortableFunctions.dragEnd = function() { console.log('order change');};// triggered on drag end.\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/a5hik/ng-sortable/issues/comments/148840987","html_url":"https://github.com/a5hik/ng-sortable/issues/197#issuecomment-148840987","issue_url":"https://api.github.com/repos/a5hik/ng-sortable/issues/197","id":148840987,"user":{"login":"snoblucha","id":265586,"avatar_url":"https://avatars.githubusercontent.com/u/265586?v=3","gravatar_id":"","url":"https://api.github.com/users/snoblucha","html_url":"https://github.com/snoblucha","followers_url":"https://api.github.com/users/snoblucha/followers","following_url":"https://api.github.com/users/snoblucha/following{/other_user}","gists_url":"https://api.github.com/users/snoblucha/gists{/gist_id}","starred_url":"https://api.github.com/users/snoblucha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoblucha/subscriptions","organizations_url":"https://api.github.com/users/snoblucha/orgs","repos_url":"https://api.github.com/users/snoblucha/repos","events_url":"https://api.github.com/users/snoblucha/events{/privacy}","received_events_url":"https://api.github.com/users/snoblucha/received_events","type":"User","site_admin":false},"created_at":"2015-10-16T21:29:08Z","updated_at":"2015-10-16T21:29:08Z","body":"I got simmilar error, but most probably for a different reason. \r\n\r\nFor me the reason was I used ng-model=\"options\".  This is a pitfall. This scope value is overwritten later in the ng-sortable directive code to the options from as-sortable attribute. \r\n\r\nThe cause of this error is either NCtrl.pages is not an array, or it is overwritten somewhere in the directive. I recommend to set breakpoint to exception in inspector and  see what is really in the `$scope.modelValue`. "}}