Ng-change is acting weird in a directive. It seems to have a delay in the digest cycle resulting in the wrong (previous) ngModel value in controller immediately after the change.
ngModel : '='
https://codepen.io/anon/pen/moEgdG
What's going on and how to fix?
With the
ng-modeldirective on a component, I recommend using one-way (<) for the input and $setViewValue on the output:Usage:
For more information, see
ngModel)