The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

New in Angular 1.3: ng-model-options updateOn and debounce

New in Angular 1.3: ng-model-options updateOn and debounce

3:35
Now in Angular 1.3 you can cause updates to your ngModels to only occur for a given even (blur, focus, click, etc); Debouncing means that only 1 action will be registered within a specific time. This is handy for text inputs, where an action triggers a process (such as asynchronous search). ngModelOptions allows you to debounce your ngModel inputs in AngularJS apps.
Watch this lesson now
Avatar
egghead.io

Now in Angular 1.3 you can cause updates to your ngModels to only occur for a given even (blur, focus, click, etc);

Debouncing means that only 1 action will be registered within a specific time. This is handy for text inputs, where an action triggers a process (such as asynchronous search). ngModelOptions allows you to debounce your ngModel inputs in AngularJS apps.

Avatar
Thomas

The debounce/blur features of ng-model-options is a wonderful surprise. Thank you for presenting this VERY, very useful technique for my ng toolkit of tricks.

Avatar
Kent C.

Your welcome Thomas! :D Thanks!

In reply to Thomas
Avatar
Sean

Question: This is pretty amazing. Is there a lesson connecting the dots with debounced model updates to posting data back to a server to save it?

Avatar
Kent C.

No lesson like that. But you could just use this in combination with ng-change and that would work fine :-) For example: http://jsbin.com/loqego/edit

In reply to Sean
Avatar
Sean

No lesson like that. But you could just use this in combination with ng-change and that would work fine :-) For example: http://jsbin.com/loqego/edit

Oh that is magic. I tip my hat to you good sir!

In reply to Kent C.
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?