Take a look at this demo:
http://jsfiddle.net/9sqtvcou/1/
If you enter something in the input and then wait 500ms, you'll notice that changing the "external resources" to version 1.2.27 (latest v1.2 as of the date I posted this) makes it work, otherwise it doesn't.
Here is the key code snippet:
var debounceDuration = $parse($attrs.debounce)($scope);
var immediate = !!$parse($attrs.immediate)($scope);
var debouncedValue, pass;
var prevRender = ngModelController.$render.bind(ngModelController);
var commitSoon = debounce(function (viewValue) {
pass = true;
ngModelController.$setViewValue(viewValue);
pass = false;
}, parseInt(debounceDuration, 10), immediate);
ngModelController.$render = function () {
prevRender();
commitSoon.cancel();
//we must be first parser for this to work properly,
//so we have priority 999 so that we unshift into parsers last
debouncedValue = this.$viewValue;
};
ngModelController.$parsers.unshift(function (value) {
if (pass) {
debouncedValue = value;
return value;
} else {
commitSoon(ngModelController.$viewValue);
return debouncedValue;
}
});
Since I am not well-versed in angular, I'm curious: what exactly caused the issue with angular-debounce in v1.3?
EDIT: I would appreciate an answer that includes technical specifics rather than abstract explanations.