formischForm

Directive that turns a native <form> element into a Formisch-managed form. It is exported as the FormischForm class.

<form [formischForm]="form" [formischSubmit]="handleSubmit">
  <!-- Form content here -->
</form>

Generics

Inputs

Explanation

The [formischForm] directive attaches a form store to a native <form> element. When the form is submitted, it validates the input against your schema, focuses the first invalid field, and calls your submit handler only if validation succeeds. It also adds novalidate to the element to disable the browser's own validation, since Formisch handles validation internally, and registers the element so that the submit method can reach it.

The [formischSubmit] input receives your handler as a function reference instead of calling it in the template. That way Formisch can await the promise it returns and keep form.isSubmitting() up to date, and register the pending submission with Angular's PendingTasks so server-side rendering and tests wait for it.

Declare your handler as an arrow function property. A regular class method would lose its this when it is passed as a reference.

To import the directive, add the FormischForm class to the imports array of your component.

The following APIs can be combined with formischForm.

Functions

Directives

Methods

Contributors

Thanks to all the contributors who helped make this page better!

  • GitHub profile picture of @fabian-hiller

Partners

Thanks to our partners who support the project ideally and financially.

Sponsors

Thanks to our GitHub sponsors who support the project financially.

  • GitHub profile picture of @vasilii-kovalev
  • GitHub profile picture of @UpwayShop
  • GitHub profile picture of @ruiaraujo012
  • GitHub profile picture of @hyunbinseo
  • GitHub profile picture of @nickytonline
  • GitHub profile picture of @kibertoad
  • GitHub profile picture of @caegdeveloper
  • GitHub profile picture of @Thanaen
  • GitHub profile picture of @bmoyroud
  • GitHub profile picture of @ysknsid25
  • GitHub profile picture of @dslatkin