I think that knowing more on what you want to achieve by watching 'choice' can point out to another solution, without using $watch(). But for you example - you can read the new value from the $scope.choice itself:
HTML: <select ng-model="selectedChoice" ng-options="c.name for c in choice"></select>
Comment
Hi.
About #7: There is a documentation on "$watch". It is a method on Scope object:
http://docs.angularjs.org/api/ng.$rootScope.Scope (the last method is $watch() )
As of <select> - there is also an example for this: http://docs.angularjs.org/api/ng.directive:select
I think that knowing more on what you want to achieve by watching 'choice' can point out to another solution, without using $watch().
But for you example - you can read the new value from the $scope.choice itself:
HTML: <select ng-model="selectedChoice" ng-options="c.name for c in choice"></select>
CONTROLLER:
$scope.choice = [
{ name: "Option 1", value: "opt1" },
{ name: "Option 2", value: "opt2" },
{ name: "Other", value: "other" },
{ name: "Option 4", value: "opt4" }
];
$scope.$watch('selectedChoice', function () {
if ($scope.selectedChoice.value === 'other') {
alert("other is chosen");
}
});