rxweb.io icon indicating copy to clipboard operation
rxweb.io copied to clipboard

Strongly Typed code example is incorrect

Open ajayojha opened this issue 4 years ago • 0 comments

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

ajayojha avatar Apr 11 '20 15:04 ajayojha