I have ui select inside ng-repeat and the result is going to mongodb. Below is the html code:
<div ng-repeat="category in colorObj.tagsCategories">
<span>{{category.name}}: </span>
<ui-select multiple ng-model="selected[$index]">
<ui-select-match placeholder="Select tags">{{$item.name}}</ui-select-match>
<ui-select-choices repeat="tag in category.tags">{{tag.name}}</ui-select-choices>
</ui-select>
</div>
Inside controller i set $scope.selected to be inside colorObj like below:
$scope.colorObj=getColorObj();
$scope.selected=$scope.colorObj.selected;
Function getColorObj()
return object of color from mongodb, and i dont modify $scope.colorObj.selected
anywhere else. On console.log() i see that $scope.colorObj.selected
get saved correctly inside database and get puller from server, but when in comes to controller which contain ui-select$scope.colorObj.selected
get cleaned to empty. Is there any option in ui-select i missed in documentation that is responsible for initialize or i just do something wrong?