Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IDorfForm

Optional interface for reminding about form properties. Enforces defining a config property which is needed in a class marked as @DorfForm(). Contains other useful properties which may be overriden.

example

 // order
 @DorfForm()
 @Component({selector: "test-domain-object-form"})
 class TestDomainObjectForm implements IDorfForm {
   @DorfObjectInput()
   private domainObject: Person;

   @Output()
   createUpdate = new EventEmitter<IModel>();

   constructor(public config: DorfConfigService) {}

   onSubmit() {
     let result = this["form"].value as IPerson;
     this.createUpdate.emit(result);
   }
 }
stable

Hierarchy

  • IDorfForm

Index

Properties

Optional _mapper

_mapper: DorfMapper

Potential, extended mapper which will be used for building a form.

Optional asyncValidator

asyncValidator: AsyncValidatorFn

Validates a whole form asynchronously, in a wider context than a single-field validation.

config

Mandatory service, which should be included in a form component built with DORF.

Optional onDorfReset

onDorfReset: undefined | function

Callback when resetting a form.

Optional onDorfSubmit

onDorfSubmit: undefined | function

Callback when saving a form.

Optional validator

validator: ValidatorFn

Validates a whole form, in a wider context. E.g. an introduced phone number may be OK as well as a country, but both fields together don't match (e.g. wrong first numbers, not applicable for a particular country).

Generated using TypeDoc