Angular not updating my select element based on the model

In my app I have some grouped select elements that all have the same options. When one select is changed, it checks the others to see if the new selected option has already been selected in any of the other selects. If it has already been selected, there is some logic to dynamically select an option that hasn't already been selected in the other selects. Sometimes, this logic leads to the same option being selected as before. When this happens, my select element is not updated, and it is out of synch with my model.

I've created a pretty simple jsFiddle that shows this here: http://jsfiddle.net/wvLHw/

Commented out in there is one possible workaround that I've found, but I don't know how possible it is to do in my app. Is there a better way to get this working right? Is there some reason why angular isn't updating the select element based on my model?

This was an angularjs issue with version 1.0.2 that has been fixed in 1.0.3.

This should now work for you

$scope.myOnChange = function() {
    //more logic here, but ends up back at c
    $scope.foo = "c";
}

I'm not sure if I'm interpreting your question correctly but I'm assuming that you've got several selects and when a value in one of those selects changes you want to execute some logic (based on other selects' values) that would eventually compute final value to be set.

IF the above is correct than using $scope.$watch would cover your use-case. For the sake of example let's assume that I've got 2 selects bound to 2 different model values (foo and bar). If someone changes value of foo and it is equal to what is selected for bar you would like to force foo to be something else. In such scenario this code would do the trick:

$scope.$watch('foo', function(fooValue){
    if (fooValue === $scope.bar){
        $scope.foo = 'a';
    }
});

Here is the complete jsFiddle: http://jsfiddle.net/pkozlowski_opensource/vqjKq/3/

I hope that I'm interpreting your use-case correctly but if not please comment on this answer, I will be happy to provide updates.