我正在使用下面的库在我的 AngularJS 模块中使用自动完成指令!。 [https://github.com/JustGoscha/allmighty-autocomplete]
我想在用户停止输入时执行一个函数,有什么办法可以做到这一点吗?
最佳答案
您可以使用ng-change
来做到这一点和ng-model-options
(仅限 Angular 1.3+):
<input type="text"
ng-model="myVar"
ng-model-options="{debounce: 1000}"
ng-change="functionToBeCalled()"/>
关于javascript - 当用户停止在 AngularJS 中输入时执行函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43048970/