Select more than one item in select or something similar Angularjs

Asked

Viewed 265 times

1

I need to select more than one option in my select or something like it, there is this possibility?

<select ng-model="modelcompraevenda.filial" class="form-control" >
      <option  ng-selected="data.unit == 1"  ng-selected="true" 
               ng-repeat="x in modelcompraevenda.listFiliais" 
               value="{{x.idFilial}}">{{x.nomeFilial}}>
      </option>
</select>
  • 1

    The HTML has multiple native. An attribute of the <select>. You already tested that?

  • do not know, I will research on

1 answer

1


Gabriel,

Like the @Sergio said, you can use the component multiple in his select.

(function(angular) {
  angular.module('app', []).controller('ctrl', ['$scope', function($scope) {}]);
})(window.angular);
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js">
</script>
<div ng-app="app">
  <div ng-controller="ctrl">
    <select ng-model="selecionados" multiple>
      <option value="1">Valor 1</option>
      <option value="2">Valor 2</option>
      <option value="3">Valor 3</option>
    </select>
    <p>MultiSelect Selecionados = {{selecionados}}</p>
  </div>
</div>

you can replace the Option for his ng-repeat normally.

Enjoy and read more about the Select no Angularjs

  • 1

    Jackson took the liberty of putting his example in his answer, angular, jquery, javascript with interactions with HTML works and there is an answer to my very complete view ... !!! If you can’t reverse !!!

  • 1

    Thanks @Virgilionovic, I wrote so little code I didn’t even think about it :) .

Browser other questions tagged

You are not signed in. Login or sign up in order to post.