I have a weird problem. So at work, I have to refactor a reactive form . I have to componentize part of the form. I have to validate a child component input on the parent form but for some weird reason it doesnt work.
I tried it on my personal laptop and it's working fine. I can validate a child form, but my computer at work won't.
parent form validation: this is just part of it.
corporate_credit_card: this.fb.group({
source_attributes: this.fb.group({
number: ['', [Validators.maxLength(21),Validators.required]]
})
child form html:
<div [formGroup]="parentForm">
<div
class="mt-5 col"
formGroupName="corporate_credit_card"
>
<div formGroupName="source_attributes">
<input
class="form-control"
id="company_cc_name"
type="text"
name="company_cc_name"
formControlName="name"
placeholder="Credit Card Name"
autocomplete="off"
>
</div>
</div>
</div>
how I check if the validation is working:
<pre>{{this.parentForm.get('corporate_credit_card.source_attributes.number').errors | json}}</pre>
**I remake a something like this on my personal laptop and its working but here at work it doesn't.
