How to submit form to server in Angular2?

前端 未结 4 1545
萌比男神i
萌比男神i 2020-12-01 03:47

Now the submission has been caught by angular2 even with action= in the

.

demo link: http://plnkr.co/edit/4wpTwN0iCPeublhNumT5?p=preview



        
4条回答
  •  青春惊慌失措
    2020-12-01 04:04

    You can also submit form in this way.

    Here is HTML markup.

    
      (...)
      
      (...)
      
    
    

    And here is code in your .ts file.

    onSubmit(e) {
        e.target.submit();
      }
    

提交回复
热议问题