In my angular application, I added default value of Id as 0
. but when user reset the form, it cleared off.
how to reset the form with default values remaining?
here is my form :
this.createForm = this.formBuilder.group({
'Id': new FormControl({ value: 0, disabled: true }, [Validators.required])
});
I tried like this:
dismissEditPop() {
this.createForm.reset();
this.createForm.setValue({ //setting back not working!!
Id: 0
});
this.modalBackdrop = false;
this.editPopup = false;
this.deletePopup = false;
this.addRowData = false;
}