You can configure the observer as follows:
$scope.$watch('myDate', function(oldValue, newValue) { $scope.barFunc(newValue);
});
but you also need to define your custom object:
$scope.custom = { value: '' };
and it should work. I do not feel that this is the best solution. I usually like it if I set up the observers because I donβt understand why something is not working as expected, then itβs better to understand why it is not working. I get what you are trying to do and offer it only as something to quickly solve your problem if you need it.
source share