. . Plunker. , ; TextBoxCtrl UserCtrl pre post, . - watcher varibale , textBox. , UserCtrl watcher. :
{{ user.textBox.name }}
user:
link: function($scope, $element, $attrs, ctrl) {
$scope.textBox = ctrl
},
controller: function($scope) {
var vm = this;
var watcher = $scope.$watch('textBox', function(newVal) {
if(newVal) {
vm.textBox = newVal;
watcher();
}
});
}
. .