Skip to content

Latest commit

 

History

History
46 lines (37 loc) · 1.38 KB

getting-started.md

File metadata and controls

46 lines (37 loc) · 1.38 KB

Getting started with the form builder

Installation

You can install this package using NPM:

$ npm i -d @mintware-de/form-builder

To use the form builder, you need to import the FormBuilderModule and the default Angular ReactiveFormsModule:

import {NgModule} from "@angular/core";
import {ReactiveFormsModule} from "@angular/forms";
import {FormBuilderModule} from "@mintware-de/form-builder";

@NgModule({
  imports: [
    FormBuilderModule,
    ReactiveFormsModule
  ],
})
export class AppModule {
}

Creating form elements

The form builder is designed for reusability. Every field of a form consists of three parts:

  • a custom Angular Component which contains the code for displaying the field,
  • a form field type, which is a subtype of AbstractType and is used in the model,
  • an configuration object.

Additionally to this, the form builder knows three types of form fields:

  • simple form fields, for example a text field or a password field,
  • collection fields which represents a collection of any field type,
  • group fields, which are just nested form fields.

Check out the specific guides:

Rendering Forms

See Rendering Forms