rxweb.io
rxweb.io copied to clipboard
Strongly Typed code example is incorrect
Description
The example code is incorrect, which misleads the developer to right use of strongly typed. Here is code :
this.userFormGroup = this.formBuilder.formGroup(User) as IFormGroup<User>;
this.userFormGroup.controls.fullName.setValue("John");
let fullName = this.userFormGroup.value.fullName;
It must be like as below:
this.userFormGroup = this.formBuilder.formGroup(User) as IFormGroup<User>;
let user:User = this.userFormGroup.modelInstance;
Location
Here is the link: https://docs.rxweb.io/how-to/stronglyType/decorators