jquery - select2 dropdown not updating the model value in angularjs -


we have used select2 jquery plugin dropdown , used inside ng-template.when user selects select2 dropdown model used in angular not updated.

<script type="text/ng-template" id="edit"> <td>{{item.companyname}}</td> <td>{{item.firstname}}</td> <td>{{item.lastname}}</td> <td>{{item.username}}</td>       <td style="width:30%;">     <select multiple data-select-two data-allowclear="true"  class="form-control" name="id" ng-options="company company.company company in companies track company.id" data-ng-model="item.company"></select>   </td>     <td>     <button type="button"  ng-click="saveuser($index,item)" class="btn btn-sm btn-primary">         <i class="glyphicon glyphicon-floppy-save">         </i>     </button>             <button ng-click="reset($index)" class="btn btn-sm btn-primary" style="margin-right:0px">         <i class="glyphicon glyphicon-remove">         </i>     </button> </td> 

data-select-two data-allowclear="true" directive used select2 implementation.we need both selected text , value of selected item in dropdown

is there solution ? or need dropdown clear button(inside dropdown) clearing selected item in angularjs

i have implemented dropdown using ui.slect2.but model not updating when select new dropdown value

<select multiple data-ui-select2 class="form-control" name="clientid" data-ng-model="item.company">         <option ng-repeat="company in companies" ng-selected="{{company.id== item.company.id}}" value="{{company}}">{{company.company}}</option>     </select> 


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -