Warning: include(/home/185104/domains/s185104.gridserver.com/html/wp-content/plugins/wp-synhighlight/object.php): failed to open stream: No such file or directory in /nfs/c06/h04/mnt/185104/domains/tommaitland.net/html/wp-config.php on line 42

Warning: include(): Failed opening '/home/185104/domains/s185104.gridserver.com/html/wp-content/plugins/wp-synhighlight/object.php' for inclusion (include_path='.:/usr/local/php-5.6.21/share/pear') in /nfs/c06/h04/mnt/185104/domains/tommaitland.net/html/wp-config.php on line 42
Debounced, delayed or throttled model updates in Angular 1.2+ - Tom Maitland

Tom Maitland

Creates digital things at Agency. WordPress developer. Web designer. Communicates for UN Youth Australia.

Debounced, delayed or throttled model updates in Angular 1.2+

21 November 2013

The Angular JS 1.2 update significantly changed how Angular JS handles event binding. The update meant that debouncing/delaying/throttling directives like ngAmpereDebouce¬†or error out. Googling around for updated solutions didn’t yield much so I mashed together a nice solution using some code from this StackOverflow question. All resulted in this – a debounce/delay/throttled model update script for Angular JS 1.2+.

The directive delays Angular model updates until an input stops changing for 1000ms, it will also push an update on blur.