I'm struggling to create a division in my select/option dropdown menu. The dropdown structure I am aiming for is as follows:
- NO IMAGE
CUSTOM IMAGE
rest of data....
Despite my efforts, the code doesn't seem to be working as expected. Can anyone provide assistance?
controller
$scope.teamListWithOptions.push({ name: "NO IMAGE" }, { name: "CUSTOM IMAGE" }, { name: "____________", notSelectable: true });
//this just adds the rest of the data
for (var a = 0; a < data.length; a++) {
$scope.teamListWithOptions.push(data[a]);
}
html
<select class="form-control" ng-model="contentTeam1Selected" ng-change="selectContentTeam1(contentTeam1Selected)"
ng-options="team as team.name for team in teamListWithOptions" ng-disabled="team.notSelectable">
</select>