syncrea / ng-rfx

Angular Reactive Forms Extension
https://syncrea.ch/ng-rfx
11 stars 3 forks source link

Unable to set value and disabled as default #42

Open miladvafaeifard opened 1 year ago

miladvafaeifard commented 1 year ago
interface SimpleForm {
  firstName: string;
  lastName: string; 
}

const form = new TypedFormGroup<SimpleForm>({
  firstName: new TypedFormControl({ value: 'Adam', disabled: true }),
  lastName: new TypedFormControl({ value: 'Adam', disabled: true })
});

additionally, how possible to create a form definition structure in this case with { value: string, disabled: boolean } ?

miladvafaeifard commented 1 year ago

I have created a PR that resolve this case: https://github.com/syncrea/ng-rfx/pull/43 your consideration and review would be highly appriecated :)