HTML:
<select chosen multiple class="form-control" ng-model="model.Skills"
ng-options="skills.name.skillName for skills in skills"
data-placeholder="Select Skills" >
<option value=""></option>
</select>
$scope.skills = [
{
"skillName": "C",
"idx": "0"
},
{
"skillName": "C++",
"idx": "1"
},
{
"skillName": "Java",
"idx": "2"
}
]
idx is index of the skills . My angular chosen does multi selection. I wanted to set my default value as Java and C
so I set it as following
$scope.model = {};
$scope.model.Skills = [2,1];
$scope.selected = 2;
but its not working out. https://plnkr.co/edit/cQEB5T?p=preview I used following example.
Change your code according to this code snippet...