{"action":"closed","issue":{"url":"https://api.github.com/repos/select2/select2/issues/4140","repository_url":"https://api.github.com/repos/select2/select2","labels_url":"https://api.github.com/repos/select2/select2/issues/4140/labels{/name}","comments_url":"https://api.github.com/repos/select2/select2/issues/4140/comments","events_url":"https://api.github.com/repos/select2/select2/issues/4140/events","html_url":"https://github.com/select2/select2/issues/4140","id":130634313,"number":4140,"title":"Select2 not rendering for the second time","user":{"login":"lpotapczuk","id":9539850,"avatar_url":"https://avatars.githubusercontent.com/u/9539850?v=3","gravatar_id":"","url":"https://api.github.com/users/lpotapczuk","html_url":"https://github.com/lpotapczuk","followers_url":"https://api.github.com/users/lpotapczuk/followers","following_url":"https://api.github.com/users/lpotapczuk/following{/other_user}","gists_url":"https://api.github.com/users/lpotapczuk/gists{/gist_id}","starred_url":"https://api.github.com/users/lpotapczuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpotapczuk/subscriptions","organizations_url":"https://api.github.com/users/lpotapczuk/orgs","repos_url":"https://api.github.com/users/lpotapczuk/repos","events_url":"https://api.github.com/users/lpotapczuk/events{/privacy}","received_events_url":"https://api.github.com/users/lpotapczuk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-02T10:04:58Z","updated_at":"2016-02-02T18:03:32Z","closed_at":"2016-02-02T18:03:32Z","body":"Hi!\r\n\r\nI am wondering if any of you had any issues with rendering Select2 element. I am building Angular app, where I use ui-router, and have two states: home, and home.news. I use Select2 element in my home.news view, which renders correctly for the first time. However, when I am coming back to the home page, and go to the home.news again, it does not render at all. I render it in my controller as with: \r\n\r\n```js\r\n            $(document).ready(function() {  // not working without document ready\r\n                $(\".role-select\").select2({\r\n                    placeholder: \"Select news\",\r\n                    width: '100%'\r\n                });\r\n            });\r\n```\r\n\r\nBesides that, if I try to remove `$(document).ready()`, the element doesnt render at all.\r\n\r\nAny ideas?"}}