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 is not connected
The modal is added to a <modal-placeholder>
element which is a direct child to <app-root>
, my top level element.
What's the correct way to removing a form from the DOM and getting rid of this error in Angular 2? I currently use componentRef.destroy();
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…