formischFieldArray

Structural directive that creates a typed field array store for a path and exposes it as the implicit context of the template. It is exported as the FormischFieldArray class.

<ng-container *formischFieldArray="['todos'] of form; let fieldArray">
  <!-- Field array content here -->
</ng-container>

Generics

Inputs

Context

Explanation

The *formischFieldArray directive is a thin wrapper around injectFieldArray that lets you create a field array directly in your template. The path is the expression before the of keyword, and the form store follows it, which allows the context guard to infer the type of the array.

Render the items with an @for block over fieldArray.items() and use the item identifier as the track expression. The identifiers are stable across reorders, so Angular moves the existing DOM instead of recreating it. Combine the index of the @for block with *formischField to address the fields of an item, and use the insert, move, remove, replace and swap methods to change the array.

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

The following APIs can be combined with formischFieldArray.

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