0

I have added a multiple select using this plunker http://jsfiddle.net/ishanbakshi/fyhsz9ra/ .and it's working succesfully but now i want to get the value of multiple select in ng-model(angularjs).nad i have tried like this.but failed.

Code:

  <select multiple id="e1" style="width:300px" name="cities" ng-init="get_city_by_search()" ng-model="submitAdsFormData.cities[$index]">
      <option value="{{x.id}}" ng-repeat ="x in searchResult">{{x.name}}</option>
  </select> 

So, can anyone help me to get this.Thanks in advance.and also any help will be appreciated.

dev_02
  • 19
  • 5
  • may be this will solve your problem https://stackoverflow.com/questions/35167463/angular2-how-bind-to-select-multiple –  Feb 07 '18 at 12:52
  • @UsamaAzam the link you provided is about Angular (2+). The OP is asking a question about AngularJS (1.x) – lealceldeiro Feb 08 '18 at 14:24
  • @lealceldeiro so have you got my question? – dev_02 Feb 09 '18 at 05:01
  • Yes, @dev_02, but I need to see an example of what you're doing exactly in order to help you better. So far, I can see that you are using `$index` outside the `ng-repeat`. I also saw the jsfiddle you provided but there is no AngularJS code there. Can you make a jsfiddle with your actual code. – lealceldeiro Feb 09 '18 at 14:02

0 Answers0