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

前端 未结 10 743
被撕碎了的回忆
被撕碎了的回忆 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:26

    Maybe you are routing to some other page on your form submission. Use programmatic route navigation, as in the example that follows, rather than passing routerlink into the template:

    router.navigate(['/your/router/path'])

提交回复
热议问题