I am trying to use Select2 along with AngularJs. I am stuck at achieving two-way data binding using ng-model directive for select2. Also other directives like ng-change is also not working for me.
My guess is I am missing some initial setup that binds AngularJs with Select2.js. Can someone please point out what the minimal requirement for using select2 in AngularJs?
<div ng-controller="sampleController">
<select id="e1" ui-select2 ng-model="select2.text" ng-change ="change()" data-placeholder="Pick a number">
    <option value=""></option>
    <option ng-repeat="number in range" value="{{number.text}}">{{number.text}}</option>
</select>    
function sampleController($scope,$timeout){
    $scope.select2={text:"",id:""};
    $scope.range=[{text:"name1", value:"id1"},
    {text:"namea2", value:"id2"},
    {text:"name3", value:"id3"}];
    $timeout(function(){
        $("#e1").select2();},10
    )
    $scope.change = function()
    {//not able to reach this function on ng-change
        $scope.select2=$scope.range[1];
    }
}