Hello all, I’m trying to figure out what the best practice is for creating a form component.
First, I can create a component and put the form element in the template or I can change the tag name for the component to ‘form’. Which one is usually the best way to go?
Second, I see many examples online that add {{action 'some action' on='submit}}
on the form element (which is not possible when making the component tagName a form?) versus adding an action on the submit button.
Third, Is it best practice to fully decouple the model from the component even when the form is operating on all the model properties? So I would create separate attributes in my component that matches each property in the model and do the setting of the properties on the model on submit instead of relying on the 2 way binding if I just used the input helper and have the value tied directly to the model properties.
Thanks and appreciate any other tips for best practices involving components.