{"action":"created","issue":{"url":"https://api.github.com/repos/select2/select2/issues/247","labels_url":"https://api.github.com/repos/select2/select2/issues/247/labels{/name}","comments_url":"https://api.github.com/repos/select2/select2/issues/247/comments","events_url":"https://api.github.com/repos/select2/select2/issues/247/events","html_url":"https://github.com/select2/select2/issues/247","id":5735480,"number":247,"title":"Getting search term","user":{"login":"ZorGleH","id":301781,"avatar_url":"https://avatars.githubusercontent.com/u/301781?v=3","gravatar_id":"","url":"https://api.github.com/users/ZorGleH","html_url":"https://github.com/ZorGleH","followers_url":"https://api.github.com/users/ZorGleH/followers","following_url":"https://api.github.com/users/ZorGleH/following{/other_user}","gists_url":"https://api.github.com/users/ZorGleH/gists{/gist_id}","starred_url":"https://api.github.com/users/ZorGleH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZorGleH/subscriptions","organizations_url":"https://api.github.com/users/ZorGleH/orgs","repos_url":"https://api.github.com/users/ZorGleH/repos","events_url":"https://api.github.com/users/ZorGleH/events{/privacy}","received_events_url":"https://api.github.com/users/ZorGleH/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2012-07-20T11:55:20Z","updated_at":"2015-06-07T16:48:25Z","closed_at":"2012-07-24T22:16:56Z","body":"Hi, is there a way to get the current term in the search input?\nI tried `$('.select2-search input').val()` but the input field is cleared before I can catch it's content when I click somewhere else on the page...\n\nThanks."},"comment":{"url":"https://api.github.com/repos/select2/select2/issues/comments/109772231","html_url":"https://github.com/select2/select2/issues/247#issuecomment-109772231","issue_url":"https://api.github.com/repos/select2/select2/issues/247","id":109772231,"user":{"login":"mrnoway","id":8749612,"avatar_url":"https://avatars.githubusercontent.com/u/8749612?v=3","gravatar_id":"","url":"https://api.github.com/users/mrnoway","html_url":"https://github.com/mrnoway","followers_url":"https://api.github.com/users/mrnoway/followers","following_url":"https://api.github.com/users/mrnoway/following{/other_user}","gists_url":"https://api.github.com/users/mrnoway/gists{/gist_id}","starred_url":"https://api.github.com/users/mrnoway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrnoway/subscriptions","organizations_url":"https://api.github.com/users/mrnoway/orgs","repos_url":"https://api.github.com/users/mrnoway/repos","events_url":"https://api.github.com/users/mrnoway/events{/privacy}","received_events_url":"https://api.github.com/users/mrnoway/received_events","type":"User","site_admin":false},"created_at":"2015-06-07T16:48:25Z","updated_at":"2015-06-07T16:48:25Z","body":"I took a long look at at the compiled results and this gave me a proper solution.\r\n\r\nsetInterval(function(){\r\n        console.log( $(\".select2-sizer\").html() );        \r\n    },1000);\r\n\r\nThe focused input box (actually div) has always an unique class \"select2-sizer\".\r\nThe above code gives me every second the so far written search input.\r\n\r\n(better ) I guess if you add an ng-model into the template you could use a watch function to trigger every change without interval.\r\n\r\nWhy I need this?\r\nBasically to load asynchronous stuff. I did not understand the provided ajax example, so I wanted to build a one on my own :)\r\n"}}