AngularJS Example:
HTML
<div ng-app>
<div ng-controller="CtrlA">
<div ng-controller="CtrlB">
gft <select ng-model="selectedItem" ng-options="item for item in items">
</select>
</div>
</div>
</div>
CSS
</style> <!-- Ugly Hack due to jsFiddle issue: http://goo.gl/BUfGZ -->
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<script src="http://code.angularjs.org/1.0.3/angular.js"></script>
<style>
crfcccdxefgfggxffrdreeaA
JavaScript
function CtrlA($scope) {
$scope.$watch(function watchA() {
return { a: $scope.selectedItem};
}, function(value) {
if (value && value.a) console.log('A: ' + value.a);
}, true);
$scope.items = ['x', 'y'];
$scope.selectedItem = $scope.items[0];
console.log('A: ' + $scope.selectedItem);
}
function CtrlB($scope) {
$scope.$watch(function watchB() {
return { b: $scope.selectedItem};
}, function(value) {
if (value && value.b) console.log('B: ' + value.b);
}, true);
}