Shantanu Lawande
Shantanu Lawande

Reputation: 79

How to make md-search-text-change wait for 1000ms before firing a call?

Presently, the md-search-text-change event fires a call every time I type something in . I want to delay this. I've tried using debounce. But that has not worked.

Upvotes: 3

Views: 2240

Answers (2)

MGE
MGE

Reputation: 11

the best way of doing so is by using AngularJs md-autocomplete directives. You just need to add md-delay="" and/or md-min-length="" (in case you want to start searching after a certain input length).

Hope it helped though a bit late.

Upvotes: 0

Karan Shishoo
Karan Shishoo

Reputation: 2801

You can use the 'md-delay' attribute of md-autocomplete to achieve this. look at the documentation for more help:

https://material.angularjs.org/1.1.5/api/directive/mdAutocomplete

Upvotes: 5

Related Questions