angular.js
angular.js copied to clipboard
ngModelWatch breaks if $modelValue is object
When using ngModel inside custom directive there is a chance to break ngModelWatch fn. On the first run ngModelWatch will set $modelValue to ngModelGet($scope). Then, if you change property of that scope var (ngModelGet($scope)) it will change the properties on the $modelValue, because it is the same object! So if you have some $formatters they won't be called at all.
Here is plnkr for demonstration.
Duplicate of https://github.com/angular/angular.js/issues/5449