{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/ui-sortable/issues/388","labels_url":"https://api.github.com/repos/angular-ui/ui-sortable/issues/388/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-sortable/issues/388/comments","events_url":"https://api.github.com/repos/angular-ui/ui-sortable/issues/388/events","html_url":"https://github.com/angular-ui/ui-sortable/issues/388","id":109522179,"number":388,"title":"Accessing other methods from the controller within the \"stop\" handler","user":{"login":"finalcut","id":108001,"avatar_url":"https://avatars.githubusercontent.com/u/108001?v=3","gravatar_id":"","url":"https://api.github.com/users/finalcut","html_url":"https://github.com/finalcut","followers_url":"https://api.github.com/users/finalcut/followers","following_url":"https://api.github.com/users/finalcut/following{/other_user}","gists_url":"https://api.github.com/users/finalcut/gists{/gist_id}","starred_url":"https://api.github.com/users/finalcut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/finalcut/subscriptions","organizations_url":"https://api.github.com/users/finalcut/orgs","repos_url":"https://api.github.com/users/finalcut/repos","events_url":"https://api.github.com/users/finalcut/events{/privacy}","received_events_url":"https://api.github.com/users/finalcut/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular-ui/ui-sortable/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-02T16:09:29Z","updated_at":"2015-10-02T18:14:24Z","closed_at":"2015-10-02T18:02:03Z","body":"I dont want to load up my $scope with a bunch of stuff so perhaps this directive won't work for my needs - or maybe I'm missing something.\r\n\r\nWhat I'd like to do is, from within my controller do something like this:\r\n\r\n```js\r\nclass ListController{\r\n  constructor($scope, listService){\r\n    this.listManager = new ListManager(listService);\r\n    this.sortableOptions = {\r\n       stop: this.moveItem\r\n    };\r\n  }\r\n  moveItem(event, ui){\r\n    ...\r\n    return this.listManager.saveOrderChange(ui.item.sortable.sourceModel);\r\n    ...\r\n  }\r\n}\r\n```\r\nHowever, this once I'm in the `this.moveItem` method `this` is no longer the controller but the `ul`; I've lost complete track of the scope of the method.  Is there a way to get it that I don't know?"},"comment":{"url":"https://api.github.com/repos/angular-ui/ui-sortable/issues/comments/145112447","html_url":"https://github.com/angular-ui/ui-sortable/issues/388#issuecomment-145112447","issue_url":"https://api.github.com/repos/angular-ui/ui-sortable/issues/388","id":145112447,"user":{"login":"thgreasi","id":1295829,"avatar_url":"https://avatars.githubusercontent.com/u/1295829?v=3","gravatar_id":"","url":"https://api.github.com/users/thgreasi","html_url":"https://github.com/thgreasi","followers_url":"https://api.github.com/users/thgreasi/followers","following_url":"https://api.github.com/users/thgreasi/following{/other_user}","gists_url":"https://api.github.com/users/thgreasi/gists{/gist_id}","starred_url":"https://api.github.com/users/thgreasi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thgreasi/subscriptions","organizations_url":"https://api.github.com/users/thgreasi/orgs","repos_url":"https://api.github.com/users/thgreasi/repos","events_url":"https://api.github.com/users/thgreasi/events{/privacy}","received_events_url":"https://api.github.com/users/thgreasi/received_events","type":"User","site_admin":false},"created_at":"2015-10-02T18:14:24Z","updated_at":"2015-10-02T18:14:24Z","body":"`bind` is more fancy than `apply` I think :smile: "}}