Angular: Empty Fiddle
http://angularjs.org/
HTML
<div ng-controller="MyCtrl">
<select ng-model="selectBox" ng-options="item for item in items"></select>
<my-directive select="{{selectBox}}"></my-directive>
</div>
JavaScript
var myApp = angular.module('myApp',[]);
myApp.directive('myDirective', function () {
return {
restrict:'E',
scope: {
select: '@select'
},
link: function (scope, element, attr) {
scope.$watch('select', function(newValue){
console.log(attr.select);
});
}
}
});
function MyCtrl($scope) {
$scope.items = ['test1', 'test2'];
$scope.selectBox = $scope.items[0];
}