I have a dropdown select with grouped ng-options. The user should be able to dynamically change the naming of the group name in an input field. On change of the group name value the select directive is not being updated unless you make a new selection.
Anybody had the same kind of problem?
Here's the jsbin: http://jsbin.com/ziyeduzalo/edit?html,js,output
This is how my code looks: .js
$scope.players = [
{name: 'Gene', team: 'alpha'},
{name: 'George', team: 'beta'},
];
$scope.change = function() {
$scope.players[0].team = 'new-group-name';
};
.html
<select ng-options="player.name group by player.team for player in players " ng-model="systemType.tertiaryEquipment"></select>
UPDATE: This seem to work in older versions of angular then 1.4.x.
track by player.teamon the end of ng-options. jsfiddle – Jose Rocha May 13 '16 at 12:04