JS: AngularJS Debounced Function Factory