I have a problem when angular's ng-change is called when model is changed programmatically.
$scope.sendMessage = function() {
$scope.message = "Message sent";
}
$scope.confirmed = true;
$scope.mySelectBox = $scope.selects[1];
<select ng-model="mySelectBox"
ng-options="item.name for item in selects track by item.name"
ng-change="sendMessage()">
</select>
Here is code example: http://plnkr.co/edit/R4MO86ihMrauHXhpCMxi?p=preview
Message should be null, because sendMessage
shouldn't be called. Model is changed programmatically.
According to docs, you're right.
https://docs.angularjs.org/api/ng/directive/ngChange
but this seems to be a bug caused by the order in which the events are hooked up
The best way round it - with resorting to js handler (onchange)
See plunk http://plnkr.co/edit/2ZbxS1tszppR9SrNqxVB?p=preview
HTH