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

Share this video with your friends

Send Tweet

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.

Thomas Burleson
Thomas Burleson
~ 10 years ago

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.

Kent C. Dodds
Kent C. Dodds(instructor)
~ 10 years ago

Your welcome Thomas! :D Thanks!

Sean Poulter
Sean Poulter
~ 10 years ago

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?

Kent C. Dodds
Kent C. Dodds(instructor)
~ 10 years ago

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

Sean Poulter
Sean Poulter
~ 10 years ago

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!