app.directive('labelField', function () {
return {
restrict: 'AE',
link: function ($scope, element, attrs) {
$scope.$watch(attrs['ngModel'], function (newValue) {
if (newValue) {
element[0].value = newValue[attrs['labelField']];
}
})
}
}
})
app.directive('labelField', function () {
return {
restrict: 'AE',
link: function ($scope, element, attrs) {
$scope.$watch(attrs['ngModel'], function (newValue) {
if (newValue) {
element[0].value = newValue[attrs['labelField']];
}
})
}
}
})