{"action":"closed","issue":{"url":"https://api.github.com/repos/miguelcobain/ember-cli-selectize/issues/44","labels_url":"https://api.github.com/repos/miguelcobain/ember-cli-selectize/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/miguelcobain/ember-cli-selectize/issues/44/comments","events_url":"https://api.github.com/repos/miguelcobain/ember-cli-selectize/issues/44/events","html_url":"https://github.com/miguelcobain/ember-cli-selectize/issues/44","id":62706922,"number":44,"title":"When passing objects as content/selection removing them throws error","user":{"login":"LevelbossMike","id":242299,"avatar_url":"https://avatars.githubusercontent.com/u/242299?v=3","gravatar_id":"","url":"https://api.github.com/users/LevelbossMike","html_url":"https://github.com/LevelbossMike","followers_url":"https://api.github.com/users/LevelbossMike/followers","following_url":"https://api.github.com/users/LevelbossMike/following{/other_user}","gists_url":"https://api.github.com/users/LevelbossMike/gists{/gist_id}","starred_url":"https://api.github.com/users/LevelbossMike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LevelbossMike/subscriptions","organizations_url":"https://api.github.com/users/LevelbossMike/orgs","repos_url":"https://api.github.com/users/LevelbossMike/repos","events_url":"https://api.github.com/users/LevelbossMike/events{/privacy}","received_events_url":"https://api.github.com/users/LevelbossMike/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-03-18T14:27:30Z","updated_at":"2015-03-18T16:51:11Z","closed_at":"2015-03-18T16:51:11Z","body":"Hi!\r\n\r\nWhen passing an array of Objects to the content property (e.g. an array of ember-data models) and using `content` as `optionsValuePath` (e.g. as needed by ember-data when working with relationships) removing an object from the selection throws an error in selectize.\r\n\r\n`Uncaught TypeError: $item.attr is not a function` in selectize's [removeItem-method](https://github.com/brianreavis/selectize.js/blob/master/src/selectize.js#L1488)\r\n\r\nBecause the observers that trigger this code are also triggered on `willDestroyElement` this also fails when removing the component from the DOM.\r\n\r\nThis makes this addon basically unusable for working with ember-data relationships which is very unfortunate because ember.select is also not working for ember-data relationships ;).\r\n\r\nI am happy to help with solving this issue but I think input from @miguelcobain would be very useful as I am not really familiar with selectize or ember-cli-selectize.\r\n\r\nAny idea what's the problem here?\r\n\r\nAnd of course thanks for this great addon!"}}