Angular 2: Form submission canceled because the form is not connected

前端 未结 10 755
被撕碎了的回忆
被撕碎了的回忆 2020-12-08 13:03

I have a modal that contains a form, when the modal is destroyed I get the following error in the console:

Form submission canceled because the form i

10条回答
  •  心在旅途
    2020-12-08 13:05

    I had this problem recently and event.preventDefault() worked for me. Add it to your click event method.

    
    

    And:

    submitForm(event: Event) {
      event.preventDefault();
      // ...
    }
    

提交回复
热议问题