I want to create a custom input component that I can use with the FormBuilder API. How do I add formControlName inside a component?
Template:
The main idea here is that you have to link the FormControl to the FormGroup, this can be done be passing the FormGroup to each input component...
So your input template might look something like the following:
{{ message }}
Where the @Input's for the input component will be form, label, inputName and message.
It would be used like this:
For more info on custom Form Input Components I would recomend taking a look through Angular's Dynamic Forms.
Also if you want more information on how to get the @Input and @Output working take a look through the Angular Docs Here