Angularjs, multi-select bootstrap with one click, no ctrl key

Is this achievable? I have the following form

   <select multiple class="form-control">
                <option
                        ng-model="selectedCountry.selectedLocations"
                        ng-repeat="location in selectedCountry.locations"
                        ng-click="locationsSelection(location)"
                        ng-selected="selectedCountry.selectedLocations.indexOf(location)!=-1">{{loc}}
                </option>

   </select>

      

That the code gives me a list of countries, by pressing a key ctrl, I can do a multiselct, but I want to do it with one click and don't know how. I used selected ng directives, but it only selects multiple places if I load back (if I click on another list and go back to the list of countries, it will download and highlight all previously clicked countries) I have a scope that has all the countries. which have been pressed, but I cannot select multiple countries from the list without pressing a key ctrl.

Any help would be appreciated.

thank

PS:

I created an example of what I have.

http://plnkr.co/edit/We3k6Pc93RKHicmhsJVu?p=preview

I want my list to look like the example. At the moment I can select multiple times, but I need to use a key ctrl. I want to be able to click once in place and select it and if I click again it will deselect without using a key ctrl.

Hope my example is clear now. Thanks you

+3


source to share





All Articles