# FieldStore

> This document is the Markdown version of [formisch.dev/angular/api/FieldStore/](https://formisch.dev/angular/api/FieldStore/). For the complete documentation index, see [llms.txt](https://formisch.dev/llms.txt).

Field store interface that provides reactive access to the state of a field created with [`injectField`](/angular/api/injectField.md) or the [`*formischField`](/angular/api/formischField.md) directive.

## Generics

- `TSchema` `extends FormSchema`
- `TFieldPath` `extends RequiredPath`

## Definition

- `FieldStore`
  - `path` `ValidPath<v.InferInput<TSchema>, TFieldPath>`
  - `name` `Signal<string>`
  - `input` `Signal<PartialValues<PathValue<v.InferInput<TSchema>, TFieldPath>>>`
  - `errors` `Signal<[string, ...string[]] | null>`
  - `isTouched` `Signal<boolean>`
  - `isEdited` `Signal<boolean>`
  - `isDirty` `Signal<boolean>`
  - `isValid` `Signal<boolean>`
  - `setInput` `(value: PartialValues<PathValue<v.InferInput<TSchema>, TFieldPath>>) => void`

### Explanation

Every reactive property of the field store is an Angular signal, so you call it as a function. The only exception is `path`, which is a plain value.

The `name` signal contains the JSON-stringified path of the field, which the [`[formischControl]`](/angular/api/formischControl.md) directive writes to the `name` attribute of the element. It is also useful as the `id` of an input so that a label and an error message can reference it.

Use `setInput` to change the value of the field programmatically. It updates the input and validates it like an `input` event would, so whether validation runs is controlled by the `validate` and `revalidate` config of your form — see the [validation](/angular/guides/validation.md) guide.

The field store additionally carries an internal element-binding contract that the [`[formischControl]`](/angular/api/formischControl.md) directive consumes. It is not part of the public API.
