0

My team and I are new to Angular and currently have the mindset of creating a reusable library of Components to use across projects.

Is it common for teams to create Angular components for each type of input field to reuse? for example: EmailFieldComponent, PasswordFieldComponent, ect.. Or is something like this not common practice in Angular projects since I haven't been able to come across many examples of being able to attach form controls from a parent component to any form of child input field component. Especially not in a clean way.

Or is it just agreed upon for most teams to put all your form fields into one component and controlling validation from there?

1 Answer 1

0

You can create a component with input and output for the reusable component.

You have just to include the selector inside the html you want to use the component.

the procedure is explained here : https://codehandbook.org/creating-reusable-angular-components/

1
  • I understand how input and output work with angular. I am moreso concerned with passing form validation/controls from a parent component to the custom child component which would be something like form field in this context.
    – Legz4Dayz
    Mar 29, 2022 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.