reactive forms one component for add and edit forms disable edit form fields angular code example
Example 1: how to set disabled flag formgroup angular
this.form.controls['name'].disable();
<input formControlName="id" placeholder="ID" [attr.disabled]="true"></input>
Example 2: form control adding disabled and validators
value: string;
isDisabled: boolean;
fb: FormBuilder;
myGroup: FormGroup;
this.myGroup = fb.group({
form_control_name: new FormControl({
value: this.value,
disabled: this.isDisabled,
Validators.required)}
);