Hello, I am currently working on a web application using AngularJS. Within this application, I have a form where I am populating values into a multi-select dropdown.
<li ng-repeat="p in locations">
<input type="checkbox" ng-checked="master" ng-model="isTrue" ng-change="getIndex(p.Location,isTrue )" ng-name="location" required/>
<span>{{p.Location}}</span>
</li>
The values are being bound from an array called 'locations', which looks like:
0: id: 1 Location:"ABC"
1: id: 2 Location:"DEF"
2: id: 3 Location:"IJK"
My current goal is to pre-check specific values within the multi-select dropdown. For example, if I have a variable var locations="ABC,DEF"
, I want only those values to be checked initially. If you have any insights on how this can be achieved, your assistance would be greatly appreciated. Thank you!