@danielhokanson/ng-dynamic-forms-ui-material
v22.0.0
Published
Material UI package for NG Dynamic Forms
Maintainers
Readme
NG Dynamic Forms Material UI
Installation
npm i @danielhokanson/ng-dynamic-forms-ui-material -SImport
All components are standalone and are imported directly by the components that use them:
import { ReactiveFormsModule } from '@angular/forms';
import {
DynamicMaterialFormComponent,
DynamicMaterialFormControlContainerComponent
} from '@danielhokanson/ng-dynamic-forms-ui-material';
@Component({
standalone: true,
imports: [ReactiveFormsModule, DynamicMaterialFormComponent, DynamicMaterialFormControlContainerComponent],
templateUrl: './my-form.component.html'
})
export class MyFormComponent {}Usage
with DynamicMaterialFormComponent:
<form [formGroup]="myFormGroup">
<dynamic-material-form [group]="myFormGroup"
[model]="myFormModel"></dynamic-material-form>
</form>with DynamicMaterialFormControlContainerComponent:
<form [formGroup]="myFormGroup">
@for (controlModel of myFormModel; track controlModel.id) {
<dynamic-material-form-control [group]="myFormGroup"
[model]="controlModel"></dynamic-material-form-control>
}
</form>Form Controls
| Control | Model | Required Property |
|:---------------------------------------------------------------------------------: |:---------------------------: |:-----------------: |
| Autocomplete | DynamicInputModel | list |
| Checkbox | DynamicCheckboxModel | – |
| Checkbox Group | DynamicCheckboxGroupModel | – |
| Chips | DynamicInputModel | multiple: true |
| Datepicker | DynamicDatePickerModel | – |
| Input | DynamicInputModel | – |
| Radio Group | DynamicRadioGroupModel | – |
| Select | DynamicSelectModel | – |
| Slider | DynamicSliderModel | – |
| SlideToggle | DynamicSwitchModel | – |
| Textarea | DynamicTextAreaModel | – |
Custom UI Events
<form [formGroup]="myFormGroup">
<dynamic-material-form [group]="myFormGroup"
[model]="myFormModel"
(matEvent)="onMatEvent($event)"></dynamic-material-form>
</form>