📜  AngularJS | ng-submit指令

📅  最后修改于: 2021-05-13 19:56:06             🧑  作者: Mango

AngularJS中的ng-submit指令用于指定要在提交事件上运行的功能。如果该表单不包含操作,则可用于阻止该表单提交。它由

元素支持。

句法:

 Content ...  

范例1:



    
        ng-submit Directive
        
  
    
    
      

GeeksforGeeks

      

ng-submit Directive

       
            
                                               
               {{errorMsg}}                  
                            
    
    

输出:
点击前:
ng提交
点击后:
ng提交
范例2:


    
        ng-submit Directive
        
  
    
    
      

GeeksforGeeks

      

ng-submit Directive

    
            
            User Name:             

                                      
            
            
Welcome {{name}} 
             You are successfully login
             
                 
    

输出:
点击前:
ng提交
点击后:
ng提交