I'm using Angular 6 and have written API in Django.
I have a Profile model serialized under User model.
Using Postman I'm able to save records to Profile like
# JSON
{
'name': 'John',
'profile': {
'about': 'About me string'
}
}
# or form field
name = 'John'
profile.about = 'About me string'
Now, In Angular application, I am trying to send data in the same format described above to the endpoint. For that, the formGroup is like
this.aboutForm = this.fb.group({
profile: this.fb.group({
about: new FormControl('', [
Validators.required
])
})
});
And when the HTML form be like
<form [formGroup]="aboutForm" (submit)="submit()" #form="ngForm">
<textarea formControlName="profile.about"></textarea>
</form>
But this is giving error as
error service Error: "Cannot find control with name: 'profile.about'"