AngularJS submit on blur and blur on keypress
问题 I want to submit some data to the server when a input field is blurred. The User should also be able to blur the input field by pressing enter. Unfortunately this results in the following: $rootScope:inprog: $apply already in progress error. Plunkr - thanks in advance! 回答1: Here's what's happening: You press enter ng-keydown triggers (digest begins) You call target.blur() ng-blur triggers and attempts to start another digest cycle Angular complains The blur is executed synchronously and