ngx-typesafe-forms icon indicating copy to clipboard operation
ngx-typesafe-forms copied to clipboard

pristine$ not working

Open Xample opened this issue 3 years ago • 0 comments

Hello, let's consider the following code:

public aController : FormControl<AType> = new FormControl<AType>(null);
public onSetPristine(){ this.aController.markAsPristine();}

then within the html

<input [formControl]="aController">
<button (click)=onSetPristine()>Set pristine</button>
{{aController.pristine$|async}}

Initially, aController.pristine$ is true, when I change the controller it becomes false as expected. But when I mark the controller as pristine (click on "Set pristine") aController.pristine$ stays false. The regular non observable aController.pristine goes however back to true.

In short: aController.pristine$ is broken somewhere. The same applies to dirty$

Xample avatar Aug 08 '22 07:08 Xample