Disable submit button when form invalid with AngularJS

后端 未结 6 882
不思量自难忘°
不思量自难忘° 2020-11-28 19:31

I have my form like this:

6条回答
  •  执笔经年
    2020-11-28 19:56

    Selected response is correct, but someone like me, may have issues with async validation with sending request to the server-side - button will be not disabled during given request processing, so button will blink, which looks pretty strange for the users.

    To void this, you just need to handle $pending state of the form:

    
      
      
    
    

提交回复
热议问题